noli
@noli@programming.dev
- Comment on Sometimes I want to call malloc, just as a treat 9 months ago:
Is that just like the shared memory model of parallel computing or are there any added complications? Have you done this before? Please do share your experiences if so cause now I’m interested :p
- Comment on Sometimes I want to call malloc, just as a treat 9 months ago:
FreeRTOS tasks are basically processes, IIRC other rtoses have similar mechanics too
- Comment on Whitespace 9 months ago:
if(condition) statement; Is valid in typical C-style syntax.
if condition { … }
Is invalid in typical C-style syntax
- Comment on Ditching PaaS: Why I Went Back to Self-Hosting 9 months ago:
Nope, IaaS. With a VPS you are in charge of everything except for the hardware. PaaS the only thing you’re in charge of is your code.
- Comment on Why can't code be uncompiled? 10 months ago:
Does commercial mean closed source in this context though? It seems like a waste of resources not to provide the source code for an rtos.
Considering how small in size they tend to be + with their power/computational constraints I can’t imagine they have very effective DRM in place so it shouldn’t take that much to reverse engineer.
May as well just provide the source under some very restrictive license.
- Comment on Why can't code be uncompiled? 10 months ago:
Don’t you have the code in most cases? Like with e.g. freeRTOS? That’s fully open source
- Comment on Why can't code be uncompiled? 10 months ago:
Isn’t that still the same exact process as a normal compiler except in the case of embedded systems your OS is like a couple kilobytes large and just compiled along with the rest of your code?
As in, are those “crazy optimizations” not just standard compiler techniques, except applied to the entire OS+applications?
- Comment on Not mocking cobol devs but yall are severely underpaid for keeping fintech alive 11 months ago:
Flipping burgers is enough to pay for chemotherapy. Src: am european
- Comment on Average Lemmy Active Users by Month 11 months ago:
Bwoah
- Comment on Does this compiler exist? 11 months ago:
Oh yeah, it’s actually pretty extensive and expressive. If you’re interested in this sort of stuff it’s worth checking out the IR language reference a bit. Apparently you can even specify the specific garbage collection strategy on a per-function basis if you want to. They do however specify the following: “Note that LLVM itself does not contain a garbage collector, this functionality is restricted to generating machine code which can interoperate with a collector provided externally” (source: llvm.org/docs/LangRef.html#garbage-collector-stra… )
If you’re interested in this stuff it’s definitely fun to work through a part of that language reference document. It’s pretty approachable. After going through the first few chapters I had some fun writing some IR manually for some toy programs.
- Comment on Does this compiler exist? 11 months ago:
LLVM is designed in a very modular way and the LLVM IR allows you to specify e.g. if memory management should be manual/garbage collected.
You could make a frontend (design a language) for LLVM that exposes those options through some compiler directives.
In general I’d heavily recommend looking into LLVM’s documentation.
- Comment on Why Git is hard 1 year ago:
Reminds me of the old joke that monads are easy to understand, you just have to realize monads are just monoids in the class of endofunctors.
- Comment on Would nuclear reactors be feasible everywhere? 1 year ago:
What study is that? Can you give a reference?
- Comment on Fixing ancient bugs 1 year ago:
How did a bug with something like that never pop up in unit tests?
- Comment on The temptation is always there 1 year ago:
Always practice safe stacks
- Comment on How to store user's access tokens/API keys without hashing them? 1 year ago:
Couldn’t you do something like JWT except allow the client to slap on their credentials to any initial request?
From the backend side that means that if there is no valid token, you can check the request body for the credentials. If they’re not there, then it’s an unauthorized request.
You’re eliminating a singular request in a long period of time at the cost of adding complexity to both client and backend but if the customer wants to be silly that’s their fault
- Comment on Roblox Game Devs Duped by Malicious npm Packages 1 year ago:
JS was a mistake.
- Comment on Bloom filters: real-world applications 1 year ago:
That’s actually a really nice application, in this case to reduce bandwidth constraints as opposed to the usual use case of memory constraints!
- Comment on Which side are you? Javascript or Typescript 1 year ago:
The typical arguments for a dynamic typed language are that it takes less time to write something in it.
The benefits of static typed languages are that your development environment can be a lot smarter (ironically enough leading to faster development speed) and several classes of bugs being unable to happen. In a statically typed language, the IDE can detect if you’re trying to call a function that takes a number but you’re actually providing a string. In this case the IDE will let you know and you can immediately fix silly mistakes like that.
- Comment on Bloom filters: real-world applications 1 year ago:
Cool, so in this case your filter is basically a classifier ML model. How would you set the hash functions then though?
- Comment on Bloom filters: real-world applications 1 year ago:
Interesting. Do I understand it correctly if I say it’s a bloom filter where instead of setting a bit to 1 for each of the hashes, you increment a counter for that hash?
How do you infer the count then, take the minimum of all matching hashes? Because intuitively it seems to me like you would need a lot more space to avoid counts being too high
- Comment on The birth of JS 1 year ago:
I am dumb. The more things I need to think about when reading code that is not the logic of the code, the worse it is.
I’ll give a very simple example, think like you’re trying to find a bug. Assume we’re in a dynamic language that allows implicit conversion like this. We can write our code very “cleanly” as follows: `if(!someVar) doSomething();’ -> ok, now we gotta check where someVar’s value is last set to know what type of data this is. Then I need to remember or look up how those specific types are coerced into a bool.
When trying the same code in a statically typed language that doesn’t do implicit coercion that code will fail to run/compile so probably you’ll have something like this:
if(someVar.length() == 0) doSomething();
-> this time I can just look at the type of someVar to see it’s a string and it’s clear what the condition actually means.The second option is both easier to read and less bug prone even without the type system. It takes maybe 3 seconds longer to type, but if your productivity in coding is that limited by typing speed then I envy you
- Comment on The birth of JS 1 year ago:
Which is why I’m of the opinion that dynamically typed languages are evil. !!“false” should either be caught at compile time or raise an exception.
I’m thoroughly convinced that the only use of dynamically typed languages is to introduce bugs
- Comment on Bloom filters: real-world applications 1 year ago:
I know they are used in google’s BigTable. All data there is stored in seperate SSTables and you can specify that a locality group should have bloom filters generated for its SSTables. Apparently cassandra has them too.
Both are the same general application though and you already mentioned databases.
I did think about using them at some point for authentication purposes in a webservice. The idea being to check for double uses of a refresh token. This way the user database would need to store only a small amount of extra storage to check for the reuse of a refresh token and if you set the parameters accordingly, the false positives are kind of a benefit in that users cannot infinitely refresh and they actually have to reauthenticate sometimes.
- Comment on What is the best file format for configuration file? 1 year ago:
You disgust me
- Comment on Golang be like 1 year ago:
Depends on your eslint config, but yeah that’s an option.
- Comment on python < shell (for scripts) 1 year ago:
This might be an unpopular opinion but python’s speed wouldn’t even be an issue if it was 5x slower than it is now.
Python is a language designed for write-time performance, not runtime performance.
- Comment on Yearly reminder that github still does not have an IPv6 address (2023) 1 year ago:
Here: “yes it does support TLS1.3”
- Comment on Writing C++ is easy. 1 year ago:
That’s actually hilarious