It's supposed to be (currently) a fully native, Python-like language, but for GPUs primarily. Though I am seeing it as having a future as a fully native Python alternative that might get interesting.
I hope with 1.0 (havent fully read the article yet) they stop breaking language features / syntax because they did quite a few different changes over time, their overall goal is to be a fully native superset of Python.
I do see this one overtaking Nim over time, which kind of saddens me, because I like Nim for what it is, but Mojo trying to be a superset of Python is a no-brainer for most Python developers. Reminds me of how a lot of Go devs were former Python devs not C++.
> their overall goal is to be a fully native superset of Python
Not any more. That was the initial announcement, but I think then somebody actually looked at Python and realised what a complex language it is - so they refocused on being a Python-like language. Python has a reputation for being a simple language, but in reality it isn’t at all.
Honestly that doesn't really feel like a glowing endorsement of the language. "They announced a crazy goal, then rolled it back because they grossly underestimated how hard it was" doesn't give me confidence in either the long-term design or the people making it, and I feel like "a Python-like language" is both a lot less interesting and a lot more subjective. If the discussions in this thread around significant whitespace aren't already an indication, which parts of Python people think are good and which aren't will vary by person, so without saying more it's hard to tell whether it's a a language someone will love or hate.
To preempt all of the inevitable responses: yes, I'm aware that this was started by the same guy who started LLVM and Swift. That doesn't automatically mean anything he comes up with will be great, especially when it's specifically trying to be "like" a language that doesn't really have much on common with either of those; there are plenty of instances of very smart people having an overabundance of confidence when jumping into something they assume they'll excel at and getting humbled. I'd also argue both Swift and LLVM have some common criticisms that very much are in line with the same concern I've expressed here (i.e. long term design suffering due to expanded or pivoted scope; even the name LLVM alludes to some of that history of having a somewhat different goal originally). His name is enough that I'll probably always click to take a first look at anything he comes up with, but I'm not going to ignore things that seem like issues because of that either. Smart people don't need to held to a lower standard because their work should be able to speak for itself.
That is a mistake. Being fully compatible with Python was a big selling point. Now they are just another knock off that wont get enough traction to make a dent. Unless this GPU programming thing is so amazing it takes over the industry with one small niche feature, guess that is the hope.
Language-feature-wise it seems like Nim will be competitive. Ecosystem-wise… yeah it's kind of a nonstarter over in Nim land. There are not many go-to libraries and its culture is not very collaborative. People seem more enamored at what they can hack together than what they can contribute to.
Second this. Their BDFL's personality is not suited for the job IMHO.
Example: Nim's hash table data structures (Python dict, Go map) are called tables. There are several variants of these, including OrderedTable. Deleting a key from an OrderedTable had O(n) performance because Nim built an entirely new OrderedTable, filtering out the key to be deleted. There were a couple of reasons for this:
- the internal list that preserved element order was only forward threaded, making an O(1) delete impossible
- Nim tables allowed the same key to be inserted multiple times, each with different values. I thought this was a bit crazy compared to other languages.
I tried to changed OrderedTable to use a doubly-linked list to allow O(1) deletes, and to get the multiple key feature removed.
What I didn't realize is that Araq, the BDFL, used ordered tables a lot in the Nim compiler, used the multiple value feature, and didn't want to add the memory overhead of a 2nd list to OrderedTable. His main reason was "deletes don't happen too often". At that point it became impossible to convince him that for a hash table to have O(n) delete performance was ridiculous and would be unexpected for anyone using OrderedTable. I gave up, left, and haven't been back.
Andreas is simultaneously brilliant and myopic to needs outside of his own (compiler dev).
It's amazing how many fights he gets into with Status-IM engineers who are the biggest financial supporters of the project and the only noteworthy company that heavily uses Nim.
Has OrderedTable been ported to Nimony? Does it still have this bug?
OrderedTable is now a synonym for Table, ie, both are ordered. To delete a key, the key is looked up to get an index position x in a Seq, the Seq entries after x are shifted left, the Seq is trimmed of the last element, and then the entire table is rehashed because shifting the Seq invalidates the previous hash codes. The performance is better than Nim OrderedTables because at least an entirely new table isn't created, and it probably works fine for small tables, but it still isn't O(1). The performance would be similar to removing an item from a single-threaded sorted list: most painful to remove the 1st element, least painful to remove the last element, but then you still have to rehash the entire table.
Part of that is because there isn’t yet a package format and a central repository. I have a few libraries I would like to contribute or merge with similar projects.
For sure, those things would go a distance towards making it a more competitive language.
Why haven't they happened yet though...? Nim is not a young language. Leadership [Andreas] doesn't think they are more important than spending time adding another memory management option.
I don't know what @winding means, exactly, but at best this seems highly misleading. Nim had babel packages by around 2010 (when it was called Nimrod and there was a Tower of Babel name scheme) and then nimble packages since 2014 or so. Also, literally 30 seconds on https://nim-lang.org (click on Documentation) and you get to https://nimble.directory/ , search for index and get to adix which has all sorts of efficient Table variants.
There has never been much prog.lang. benefit from being "in the stdlib/core" in Nim (unlike Python or Go, say). The benefit is more "software distribution" for the dependency allergic, but the Nim culture is much less micro-deps than seems in vogue lately. All that said, I think having a more batteries core distribution is valuable - just less than you might guess - and practically that needs delegation.
And knowing the magic keyword search `adix` to arrive at a prerelease library that you yourself wrote. That not's exactly an endorsement for discoverability. Unless I'm missing something, Nimble is essentially stateless. You have no sense of how many times or how recently a library has been downloaded. These are important proxies.
> There has never been much prog.lang. benefit from being "in the stdlib/core" in Nim (unlike Python or Go, say) … more batteries core distribution is valuable - just less than you might guess
Yeah, I don't think this is the community's strong suit. It strikes me that Araq is tired of explaining himself (but doesn't care to consolidate discussion into ADRs), so when a well-meaning, would be contributor like the parent-poster comes along they get shot down and we lose them.
I only said anything at all because the implication was not "missing minor nits about whatever your favorite proxy for 'will rely' is" but rather "nothing at all". FWIW, the keyword was "index" and the result was adix, and I only meant the package system & "a" directory were discoverable. Exact keyword search systems indeed make discovery harder, but that is some whole other complaint. There are always many complaints.
There are a million ways to define both "top 10 language" and "weak std lib", but the C stdlib is not great and C++'s was bad enough to spawn Boost. And I'm sure many firms all but say "do not use" parts of many top10 stdlibs. In any event, we don't disagree that Nim's stdlib being stronger would be better or that poor delegation or unconsolidated discussion are problems. We disagree on very little, including I'm sure that there is more to a PLang than its stdlib.
What is present/missing in any stdlib (or really in almost anything period) is also often much more subtle and subjective than simple sales pitches one hears. To be concrete, there are "useful" (to someone) things in the Nim stdlib not in either Python's or Go's like std/critbits, std/pegs, ropes, packedsets, intsets, editdistance, etc. Nim stdlib substring search behind "xyz".find() is layered to let you, if you want, pre-build a `SkipTable` (the way regex engines let you pre-"compile" regexes). Subtle in diversity of both kind and granularity and subjective as in "who cares?"
Yes, all that and more is all available in all the ecosystems of anything "popular", but that brings you back to "trust proxies", like "prerelease" numbers, a very weak one, IMO. E.g., I have never used a neovim with a version >0.13, but it's been a trooper; one man's 0.7 is another's 7.0. TRUST IS TRICKY! A count of distinct reliers for some values of "distinct" and "rely" or various update patterns would be better (have their own issues, of course, but at least measures "company" as in "what misery loves", LOL).
I hope with 1.0 (havent fully read the article yet) they stop breaking language features / syntax because they did quite a few different changes over time, their overall goal is to be a fully native superset of Python.
I do see this one overtaking Nim over time, which kind of saddens me, because I like Nim for what it is, but Mojo trying to be a superset of Python is a no-brainer for most Python developers. Reminds me of how a lot of Go devs were former Python devs not C++.