Nim – version 1.2.6 and 1.0.8 released
nim-lang.org
nim-lang.org
The next series, Nim 1.4, is going to bring speed, size and predictability improvements as well as FFI that better matches e.g. Python's object life cycl. This is done by moving from the existing soft-real-time thread local mark-and-sweep collector (which works extremely well, but does impose some constraints) to a much smarter reference counting with optional cycle collector.
Nim is the only language I'm aware of with different yet practically replaceable garbage collection: RC, Mark & Sweep, Boehm, None, and a couple of deprecated ones. They all have pros/cons, but they all work well.
The new ARC (automatic reference counting) and ORC are the most promising.
No runtime, no pauses, thread-safe, verified at compile-time.
I've been eagerly following it as my company is using Nim embedded on the ESP32 -- primarily since, well, I don't care much for programming C/C++. With Nim I was able to write a JSON-RPC server in a few dozen lines and it compiles with only a few hundred kB for everything including nice error handling. My PR merged to bring experimental support for FreeRTOS/LwIP to Nim got merged into the devel branch today! If anyone wants to help out, check the Nim forums.
But as my work continued I ran into other roadblocks: bad documentation, small community. I went back to Rust, stuck with it, and now I'm very happy using Rust. But if you're looking for something low-level that you can pick up super-quickly, Nim is awesome. And the executables are crazy small, even compared to Rust.
And C++ isn't alone: None of Lisp, APL, Forth or Prolog, to name a few, sit anywhere near the Go<->Rust spectrum.
[ Most languages ] - [ Go ] - [ Some languages ] - [ Rust ] - [ Way fewer languages ]
In the above, languages are lower-level and higher performance (in general) as you move to the right.Do you guys think there is in theory, the best programming language, or will this always be subjective
I started learning Julia recently, and my first impression was , scoping rules are a mess, I like Julia a lot and I think its probably one of the better languages and better communities that exist today (but oh my, scoping, what a gafe (in my opinion))
Is scoping really still a subjective issue, do we not know yet the best approach to scope variables for example?
Static typing, Dynamic Typing, Gradual typing, will this be a debate for ever
Learning languages is big investment, and having dozens of languages around is not productive, human languages are consolidating over a few, English is by far the business language of the world
Why does language design continue to be a subjective topic? its not like computers need cultures !
How is relevant to Nim, well as I said its a bit off topic, but we can always ask the question, why does Nim exist, or do we need Nim to exist
This is like asking for "what is the best music". Do you want to dance? Relax? Party? Feel Happy?
Programming languages have target audiences: people with a certain mindest and problems to solve. A Golang hacker will be disgusted by Haskell, and vice versa, yet both languages have merit and their own fan base, working in different domains.
That said, controversial opinion incoming: I think Zig is clearly better than C, but that is the only example I can think of.
> its not like computers need cultures
Languages (really all big projects) absolutely need cultures, and in practice they all have one. Cultures is how humans cooperate, as shared values, idioms and concepts make it much more effective to do so.
Every language has trade offs, they prioritize certain features over others. This is naturally going to make some languages better than others for particular tasks.
Sorry, really basic answer here but I'm definitely curious what others think on this as well. Perhaps the above is my pessimist view on it :)
Dynamically typed languages, for example, might always be popular with users that are highly technical, but not necessarily from a comp-sci background. Say you're a Unix admin, and have to automate a bunch of work. A strongly static typed language is going to be verbose and feel heavy to you. And you don't really care about performance, since the scripts can run in 1 second or 1 minute, and either gets the job done.
On the other side of that, if you're a developer on a largish project, a dynamically typed language might feel loose to you, complicate your unit tests, or drive hard to diagnose bugs. Or perhaps the performance trade-off isn't workable.
Some of the most hardcore "comp-sci" theorists I've ever encountered work only in Scheme, a dynamically typed language.
Well, to be fair, you did use the word "always" which makes things sound... absolute.
> always be popular with users that are highly technical, but not necessarily from a comp-sci background
I edited the phrasing to make it more clear though. Apologies for anything that sounded overly authoritative. Just my opinion.
That's really what it's all about. Readable code. Different languages allow different levels of expression. You mention English as the business language that everyone speaks. Most programming languages can interface with C, and C has the largest ecosystem of libraries. Why don't we all just program in C? Because it's not very expressive. You used the words 'static', 'dynamic', and 'gradual' when discussing type systems. What if you couldn't use those words? What if you had to explain in painstaking detail what 'static' means because there wasn't a word for it? That's what it would be like if we all had to program in C.
Computers don't use programming languages. Thats why we need interpreters and compilers.
I think programming languages will always be subjective, but I could imagine a time where programming languages are obsolete for almost all use cases.
Imagine an AI with advanced NLP, that allows you to describe to a computer what you want done in your native language. Then the "programmer" never has to worry about the implementation details, just what they want done. Basically like the audio computer interface in Star Trek TNG.
I think this is because all these 'languages' are ultimately human languages and not machine languages. What I mean to say is, at the end of the day all programming languages are abstractions of the human mind to make our life easier. Some times, a hammer makes our life easier in some situations, some times you need a fork.
A programming language is literally a tool to tell the computer to /do something/, and as the /something/ changes, so does the best tool to do that something.
Human languages are easier to aggregate, I think due to context. As long as you can get somewhat close, most people will generally be able to follow along. Programming languages generally lack that context (or more likely, intentionally ignore it to prevent unpredictable behavior).
Just as an example I could say something grammatically horrible like "Julia, he went to the store." It's got gender-mismatched pronouns, and it's a weird fragment. You probably know what I mean, though. On the other hand, a computer has no idea what to do with this:
``` she = new Julia() he.went_to_store() ```
Is `he` a mistype of `she`? Did I forget to instantiate `he`?
On the topic of the "best" programming language, I don't think it exists. There are likely always going to be particular paradigms that are better suited to tackling certain problems.
If you look at typing, in particular, that varies both by problem space and person in my opinion. Some people appreciate the nudges typing gives them; other people seem to have no trouble holding type info in their head (I am not one of them). Typing also becomes less valuable the less well-defined your types become. As a rough example, something like MongoDB probably benefits from typing less than other applications because so much of the data lacks a predefined schema.
At least so far, there also seems to be a trade off between development velocity and runtime speed. Most of the languages that are fast to write are slow to run. That I think will be eventually surmountable, though.
I think there is only best for what it was design for. We should compare the language goals with other language with similar goals.
Elixir/Erlang's goal makes it quite possibly one of the best language for concurrency.
R is the best language, so far, for statistic and researcher implementing their latest paper in. It also have FFI for C++/C so if things are too slow.
Once you start to compare a general programming language such as Python it gets a bit harder to say "best" because it seems to want to do everything. It's much easier to do a few things correct/good than it is to do a lot of things good/correct.
With this mind set, we can just be more objective and choose right language for the right task, instead of picking the one language to rule them all.
edit/update: This is before we even account for the ecosystem and software around the language.
I myself would like a language ticks these boxes: - easy to use - fast, small - safe - easy to type and read (less finger and eye fatigue) - easy to debug - need to go low level if I need to, but most of the time let me just do whatever I want high level wise - can do any environment, embedded, backend, browser, cross platform, mobile, gui
I think I'm asking too much lol
> Why does language design continue to be a subjective topic? its not like computers need cultures !
Learning languages are a big investment, that is indeed true. But the comparison with English is flawed - human languages are very ambiguous by nature and often the meaning is inferred based on the context we use words. This is often apparent when one wants to write something unambiguous in English: for example, a document that is legally binding - because you want to make things as precise as possible. Most legal documents hence define terms and then use them with meticulous detail. Indeed writing these down is such a complex task that we have an entire profession dedicated to them - lawyers. So put in another way what the lawyer is doing is defining abstractions for that document and then using them to write the binding terms and conditions in the document.
How is this related to programming languages? Well, a similar argument would be we should all use assembly for programming since that is what the CPUs use anyway. You are not wrong, but that would mean so much wasted effort by programmers to define basic abstractions for every program they will ever write. Programming languages are nothing but abstractions for the problem you are solving. And problems programmers solve vary wildly - a OS or driver developer worries about vastly different problems than a data scientists and their languages show that. This is why computer do not need "cultures", but programmers do. A kernel level programmer worries about manual memory management, and handles raw pointers on their own. A data scientist just cares about manipulating tables and training models. How the memory is managed is an extra detail that is not relevant to the problem domain and languages like Python provide an abstraction for that (a garbage collector).
This is why it is always good to experiment with languages. Probably 1 in a 100 language will become mainstream, but what these experiments give us are a medium to see what abstractions work successfully to represent programs in different domains. This is how object-oriented programming or garbage collectors are mainstream today. As far as Nim goes, I think it is a language that allows you to ship compiled native binaries without manual memory management with lots of Python like language features. So the intended audience is for people who want to ship binaries but want to use expressive features like iterators, etc like Python provides.
On the one hand, many languages seem to be adopting features from one another. Perhaps they will converge towards a single language?
However, I believe whatever they are converge to will never be the right language for all purposes.
> [Julia’s] scoping rules are a mess
If there ever is a single “language to rule them all”, it’ll have to get all the basics (like scoping) right. It always amazes me how many languages have such fundamental flaws.
https://juliacomputing.com/case-studies/
Most of those libraries are Python bindings to libraries written in Fortran, C, and C++, whereas on Julia's case many libraries are pure Julia code.
Python may still be the best language for non-cutting edge deep learning, but we ought to consider whether we've overfit our algorithms to the limitations of the current system [3].
[1] https://github.com/mratsim/Arraymancer [2] https://sciml.ai/ [3] https://news.ycombinator.com/item?id=20301619