|
Or the words of someone who hates what my grandfather called "rabbit food".
|
|
|
|
|
Just consider this about rabbit food: rabbits have a pretty good time making more rabbits. That food is definitely good for something!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
The words of a ?Jedi Compost Master dreamer.
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
Chemistry has no "undo" button.
|
|
|
|
|
W∴ Balboos, GHB wrote: Now, for computers, you could break that determinsitic paradigm you have built the perfect Turing Test.
Your ways of finding one needs refinement.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
W∴ Balboos, GHB wrote: the results of specific input exactly defines the specific output It surely doesn't always feel that way
|
|
|
|
|
If you're not part of the solution, are you part of the precipitate?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
"... there's good money to be made in prolonging the problem." -- Despair
|
|
|
|
|
Said every pharmaceutical company executive on the planet.
|
|
|
|
|
Condense readers understand the difference? I won't resort to micelle for an answer, preferring to keep you readers in suspension.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Don't know, I'll have to flask my friend Florence Erlenmeyer.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Listen geneous! Its awfully political these days to be asking people if they support homo or hetero!
Tread carefully!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Did you hear about the dedicated chemist who got absorbed in his work?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I've been repurposing a bunch of my old C# code for use as C++ code on microcontroller devices.
This is going far far better than I would have ever imagined.
For starters, C# under .NET is a garbage collected memory pig.
The environment this code gets ported to could not be more different. I have 320kB of usable RAM, no garbage collection, and an allergy to new and malloc .
And yet my JSON parser i built for it was originally written in C#. It will run comfortably on 4kB of RAM. The same code on .NET uses tens of megabytes or more.
And don't get me started on my latest endeavor - stealing Microsoft .NET's SynchronizationContext paradigm for use on my ESP32 IoT devices.
Porting the code was cake, in both of the above cases. It was almost too easy.
It's shocking to me because the differences in environments and development paradigms are profound, but the code is almost copy-paste-search-replaceable in terms of porting it.
C#/.NET:
private struct Message
{
public SendOrPostCallback Callback;
public object State;
public ManualResetEventSlim FinishedEvent;
}
C++/ESP32:
struct Message
{
std::function<void(void *)> callback;
void *state;
TaskHandle_t finishedNotifyHandle;
};
It's the same code!
Callback: C++ functor vs. C# singlecast delegate
State: C++ void* vs. C# object
Finished event: C++ TaskHandle_t based notification vs C# ManualResetEvent
It's incredible how similar it is for something so platform specific. And now that C++ has things like coroutines and awaitable methods it will be even easier to port .NET code to C++ going forward.
How did this happen? When did this happen? I'm thrilled!
Real programmers use butterflies
|
|
|
|
|
OK - now it's time to really "put the pedal to the metal" and port this to C . Those last bits of fluff will fade away.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
In recent years I haven't found a good use case for strict C development except in one case (ESP8266 IDF) due to a broken developers framework.
Even my little 8-bit monsters, while not supporting most of the STL, will handle classes and functors and things like that just fine, with just 4-8kB of RAM.
I mean, several years ago it wasn't uncommon to find devices with less RAM than that. Now you have to go out of your way to find them.
So don't get me wrong - I'm not saying those use cases for C don't exist. But they seem rare these days, and I personally don't tend to encounter them.
Real programmers use butterflies
|
|
|
|
|
The suggestion was purely for sport programming.
Actually, it's been a very long time since I've done sport program. That was for FORTRAN callable assembly functions on a VAX/VMS system - myself and a (now deceased) friend would compete for who could make the most compact version of a function.
In your specific case, any space saved could be used to install some games. If none found are small enough, that becomes yet another challenging project!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
When I was younger, sport programming involved rewriting autoexec.bat and config.sys to play a game: getting the sound card and mouse working together, sometimes with EMM386, sometimes without - that kind of thing.
I'm pretty sure I spent more time and effort on that than playing the damn game sometimes!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
I remember doing that for my job. My product ran under the DOS4GW DOS Extender (just like DOOM), and I had to work really hard to have enough real-mode and protected-mode memory. I had to tweak CONFIG.SYS and AUTOEXEC.BAT settings to both allocate memory the way I needed, plus support UI languages and such.
Software Zen: delete this;
|
|
|
|
|
Quote: For starters, C# under .NET is a garbage collected memory pig.
That is one of several reasons why I have nothing what so ever to do with it.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I don't mind it because all that memory use buys me things, and I have more RAM than sense on a modern desktop anyway.
Still, it is a little off putting at first.
There are some great ideas in there though, like the way you can pass calls around to execute on other threads instead of having to do synchronization through read/write barriers.
Real programmers use butterflies
|
|
|
|
|
I did something similar just the other day in C++. At least, it seems to fit that description. Regardless, yes, there are some interesting things in there.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
modified 26-Feb-21 13:24pm.
|
|
|
|
|
honey the codewitch wrote: How did this happen? When did this happen? I'm thrilled! Easy, C# based on it.
Where is malloc in this code btw?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I don't use malloc or new directly in any of that synchronization context code. I use xRingBuffer methods which use malloc on creation based on my digging.
why do you ask?
Real programmers use butterflies
|
|
|
|