Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
MLs have a perpetually-replenishing stock of autistic FP-nerd grad students who can squeeze a term project out of writing new optimizations for their favorite ML. They'll always be pretty fast as long as that continues to be the case.
also functional languages can be compiled with a few tricks that have a habit of going to shambles as soon as somebody thinks of pressing = on their keyboards
 
As much as I'm not fond of Rust, Pydantic uses it for its backend and I love that fuckin library, so credit where it's due
 
Remember boyos, when memory safety is in doubt, stick with the stack.
 
That's SSA form, it's pretty standard for compilers tbh
It's the typical way they teach how to handle shadowing and mutation (outside of pointer shit) in compiler courses.

I've just been using bump allocators with pages from mmap, it works pretty damn well honestly
Might as well use this at that point.
 
the gnu compiler infrastructure also uses ssa
also on paragraph 4 it says this is just a poor man's version of continuation-passing style
Remember boyos, when memory safety is in doubt, stick with the stack.
i [GC PAUSE]heart gar[GC PAUSE]bage collectors
Stacks?
Where we're going we don't need stacks.
forthcels in this thread are coming to educate you right now
 
ml (and other functional languages too) always make me ask "but why?" and i can never come up with a good answer except "using it makes me feel smart"
like, it's not performant, it's not easy to write or read, the only upside seems to be that it makes me feel like a goddamn genius when i come up with super concise and elegant solutions
As mentioned it can definitely be performant. It will not be as performant as well-written C/C++/assembly but that's a tradeoff often worth making. OCaml and Jane Street were mentioned earlier. High-tech financial firms often require code that runs very fast. I don't work for Jane Street and don't know how often they drop down to C for example, or even make use of ASICs, as I've heard of before in these settings, but I assume that OCaml is sufficient for many of their needs.
Writing in functional languages is like 20% of the effort and 70% of the performance in a lot of cases, compared to C. Along with that, they usually come with a much more expressive type system that can help you reduce certain classes of errors to almost never occur. (like accidentally misusing an error code as a status one). If the types don't match up, you are more likely than not doing something wrong so the compiler tells you instead of you having to find out yourself. And much lower reliance on public mutable state reduces another kind of error, namely accidentally mutating state you shouldn't be mutating.

I am absolutely braindead, which is why I prefer functional programming languages.
I'm a big fan of Ocaml, but I don't always have the free time to fuck around with it. I've talked about it a few times in this thread over the years.

I mentioned a very interesting performance comparison between MLton (a very aggressively optimizing compiler for SML) and C++ in this post.
 
I mentioned a very interesting performance comparison between MLton (a very aggressively optimizing compiler for SML) and C++ in this post.
the moral of the story is that it's not a great idea to get into a compiler dick measuring contest with the specific group of programmers that has one of the highest compiler autist per capita rankings in the world
 
Every time I visit this thread, I am reminded that we could have lived in a world of prefix notation.

It was last brought up pages ago, but as someone who is barely pushing past being a junior level engineer, with no formal schooling, my thoughts might hold some weight.

Multiple times SICP has been brought up in this thread as a book to recommend to new programmers. There are always comments about how it is not suited for beginners. I have been programming for 3 years now, and first attempted to read it a few months after starting. I think the wonderful thing about SICP is that it is a text you can return to. I honestly originally crashed out at the first mention of recursion.

Now with some more experience, I have been able to push further and am now on the second section. I believe there is value in that and would recommend it to others. I feel that there is a certain amount of friction you need to put yourself through to grow, and if you didn't go through schooling, it is important to expose yourself to hard-to-digest material.

Just my thoughts, appreciate y'all for the banter and knowledge I have leeched.

::edit::
If anyone has other books to recommend, I am always looking for more. The next one on my list is "Working Effectively with Legacy Code"
 
Last edited:
I think the wonderful thing about SICP is that it is a text you can return to. I honestly originally crashed out at the first mention of recursion.
the first thing about sicp is that nobody is meant to be able to finish sicp in one go
not even john carmack can finish sicp in one go
if you somehow finish sicp in one go, you are probably god. how you didn't already know you were god is a mystery but this isn't really a theology thread now is it
::edit::
If anyone has other books to recommend, I am always looking for more. The next one on my list is "Working Effectively with Legacy Code"
if you want more scheme certified jewish computer magic, try "the little schemer". it's very based
Exactly the same as what happens the first time most people try recursion.
eventually it becomes such a natural way to think that you wonder why you haven't always been thinking with recursion
 
eventually it becomes such a natural way to think that you wonder why you haven't always been thinking with recursion
the problem with learning recursion is that in order to understand recursion, you first must understand recursion; sometimes if you solve for your base case, you can kinda get it by induction but that's distinct
 
the problem with learning recursion is that in order to understand recursion, you first must understand recursion; sometimes if you solve for your base case, you can kinda get it by induction but that's distinct
the easiest way to learn how recursion works is to understand a little bit of recursion and then understand the rest of recursion
see if you try to understand recursion all at once it's pretty hard, but instead, you can just understand a little bit and then understand the rest of recursion
understanding the rest of recursion is pretty easy because it's a lot like understanding recursion, which you've been working on by understanding a little bit of it and then understanding the rest of it
 
the first thing about sicp is that nobody is meant to be able to finish sicp in one go
not even john carmack can finish sicp in one go
if you somehow finish sicp in one go, you are probably god. how you didn't already know you were god is a mystery but this isn't really a theology thread now is it
imo it's not that bad once you have a decent grasp of pure FP. It's more than a paradigm; it's a mindset.
 
the problem with learning recursion is that in order to understand recursion, you first must understand recursion; sometimes if you solve for your base case, you can kinda get it by induction but that's distinct
Recursion is easy
floppa-fractal.webp
 
Back
Top Bottom