Live data from Hacker News

I learned seven programming languages

mode80.github.io

21–30 of 52 posts

Re: I learned seven programming languages

#21
post #18

The criticism of Julia seems strange: > But the big dealbreaker with Julia is it only complies on the fly. That means you can't just hand a compiled executable to someone. You must give them instructions to install Julia and all your dependencies first. That's no good for anything you want to ship like a desktop app or a game. You also don't want Julia on your server recompiling with every web request. That's an issu…

Also, you can precompile a whole package and just ship the binary. We do this all of the time.

https://github.com/JuliaLang/PackageCompiler.jl

And getting things precompiled: https://sciml.ai/news/2022/09/21/compile_time/

Re: I learned seven programming languages

#22

Earlier quoted context omitted.

I almost chose nim over rust, but then rust is an industrial machine with a ton of weight behind it. Nim may be the better language for my needs but not as good an ecosystem. Sad but true.

I agree. I love Nim, it's such a great language but I try to stick to Rust because I have a feeling that's where the industry is headed. And Rust will improve over time, maybe at some point it will be more pleasant to use.

> Maybe at some point it will be more pleasant to use.

Unless there is a complete rewrite of the borrowing rules and thus breaking changes that's highly unlikely of ever happening. Instead of following what the industry promotes, the same industry that lays off thousands of people on a whim, maybe start following community projects. Do what you like most, don't expect them to change to fit your needs and wants and stop trying to get into every trend that is hot. At least that my mantra to prevent having regrets later on. Good programmers have a future no matter what language they use.

Re: I learned seven programming languages

#23
post #4

The author's experience is based on toy examples. Programming (and designing) in a professional setting is more than that, though. And the solutions are not the same for everyone: writing an Office plugin has different needs than writing a mobile game. For many of us, the availability of tooling and libraries is crucial. I'm not going to reinvent the web server by building on OS sockets or write a graphics rendering…

Yeah, languages are "easy" to learn when you already know a few from different paradigms. I can skim through the docs of an unknown language and know enough to start writing in it quite quickly. What takes time is to also learn all the tooling, not just the syntax. How do you build it, debug it, deploy it, what frameworks and libraries should you use, and spend time to learn them. Take javascript, for instance. If yo…

They’re also easy to learn when all you want to know is syntax. What about:

* dependency management and releases

* deploying and running in prod

* footguns that affect performance or security

* libraries for helping development

* language-specific features

etc

Re: I learned seven programming languages

#24
post #18

The criticism of Julia seems strange: > But the big dealbreaker with Julia is it only complies on the fly. That means you can't just hand a compiled executable to someone. You must give them instructions to install Julia and all your dependencies first. That's no good for anything you want to ship like a desktop app or a game. You also don't want Julia on your server recompiling with every web request. That's an issu…

I don't know first hand how well it works, but py2exe is a thing.

Re: I learned seven programming languages

#25
post #4

The author's experience is based on toy examples. Programming (and designing) in a professional setting is more than that, though. And the solutions are not the same for everyone: writing an Office plugin has different needs than writing a mobile game. For many of us, the availability of tooling and libraries is crucial. I'm not going to reinvent the web server by building on OS sockets or write a graphics rendering…

The same was said for Linux, Python and many other projects when they were at a very early stage.

By your logic no community-driven project would ever be successful.

Re: I learned seven programming languages

#26
post #6

> most programmer convenience is sacrificed on the altar of "never crash". This makes it a good choice for sending a rocket to space When it comes to safety- or mission-critical software, crashing due to a dangling pointer, a stack overflow or a failed allocation are equally catastrophic, and not crashing but producing a wrong answer due to an algorithmic error is also equally catastrophic. In fact, producing the cor…

It depends on the domain. Sometimes a wrong answer is worse than a crash (e.g. a bank). Sometimes it is better (e.g. a game).

Similarly the worst bugs can be crashes (random, non-deterministic, release-mode only, timing sensitive heisenbugs), or they can be undetected algorithmic errors.

It entirely depends on the specifics. But either way, Rust's tradeoffs are easily worth it in terms of eliminating bugs unless you really don't care.

Re: I learned seven programming languages

#27
post #4

The author's experience is based on toy examples. Programming (and designing) in a professional setting is more than that, though. And the solutions are not the same for everyone: writing an Office plugin has different needs than writing a mobile game. For many of us, the availability of tooling and libraries is crucial. I'm not going to reinvent the web server by building on OS sockets or write a graphics rendering…

Yeah, languages are "easy" to learn when you already know a few from different paradigms. I can skim through the docs of an unknown language and know enough to start writing in it quite quickly. What takes time is to also learn all the tooling, not just the syntax. How do you build it, debug it, deploy it, what frameworks and libraries should you use, and spend time to learn them. Take javascript, for instance. If yo…

Even that is not a problem. Tooling and deployment are the most boring parts of any language.

What's more interesting and what's more difficult to find shortcuts for is understanding the spirit of the language, knowing its weaknesses, bottlenecks and inner workings. The threading model, what's done at compile time and what's done at run time, etc etc. There are so many things you need to learn before you can judge any given language relative to others that you know.

Re: I learned seven programming languages

#28
post #8

The author tests the seven languages python, julia, rust, c#, swift, c and nim by programming a Yahtzee bot in each and comparing them. The "winner" is nim. Unfortunately the author only provides the code for nim. So it is subjective based on a simple practical project (1000 locs). Unfortunately it leaves out all the other "cool kids" like crystal, zig, v, dart, d and so forth...

The code for other languages is in other repos:

https://github.com/mode80?tab=repositories&q=Yahtzee&type=&l...

Re: I learned seven programming languages

#30
I realise this is only a surface level comparison but the Julia code uses the built in factorial function which I think uses lookup tables and the C# version uses a recursive static method, the Python code has your own lookup table. I guess that’s on the hot path? I haven’t taken the time to check if you’ve put a lookup or memoized it somewhere.
Post reply on HN