1,112 karma · joined May 28, 2023
Nim is a language that compiles to C. So it is similar in principle to the "safe_c.h". We get power and speed of C, but in a safe and convenient language.
> It's finally, but for C
Nim has `finally` and `defer` statement that runs code at the end of scope, even if you raise.
> memory that automatically cleans itself up
Nim has ARC[1]:
"ARC is fully deterministic - the compiler automatically injects destructors when it deems that some variable is no longer needed. In this sense, it’s similar to C++ with its destructors (RAII)"
> automated reference counting
See above
> a type-safe, auto-growing vector.
Nim has sequences that are dynamically sized, type and bounds safe
> zero-cost, non-owning views
Nim has openarray, that is also "just a pointer and a length", unfortunately it's usage is limited to parameters. But there is also an experimental view types feature[2]
> explicit, type-safe result
Nim has `Option[T]`[3] in standard library
> self-documenting contracts (requires and ensures)
Nim's assert returns message on raise: `assert(foo > 0, "Foo must be positive")`
> safe, bounds-checked operations
Nim has bounds-checking enabled by default (can be disabled)
> The UNLIKELY() macro tells the compiler which branches are cold, adding zero overhead in hot paths.
Nim has likely / unlikely template[4]
------------------------------------------------------------
[1] https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...
[2] https://nim-lang.org/docs/manual_experimental.html#view-type...
I just use a it as cross-compiler for my Nim[0] programs.
[0] - https://nim-lang.org
I believe this and many of comments by tinfoilhatter under this post are not in good faith and in the most charitable interpretation written by a uninformed person or are severely outdated.
> Thanks for the offer, but there's a reason why Nim hemorrhages users as fast as it gains them, and a big reason for that, IMO, is the toxic community which definitely includes the moderation team.
I have to challenge this, because for the last couple years, there have been almost no incidents or drama. Moderation was almost exclusively dealing with spam messages. I think, on the forum, a couple posts were closed because of heated or offtopic discussions. But in all cases, participants were agreeing with the decision of mods (you can see them leaving a 'like' on mod's message).
> There was quite a bit of drama that caused the hard fork to materialize. Differences in communication styles is definitely describing the drama that unfolded, extremely mildly. I don't work on the fork or use it, but some of the more talented compiler developers who were previously contributing to Nim, left Nim to go work on Nimskull.
I know that some of people that left were also the ones causing problems with moderation and being toxic. I don't want anyone to draw strong conclusions, but Nim community was much healthier and friendly after the fork people and certain moderator leaving the project.
> He is also very difficult to work with and isn't very welcoming to newcomers. The community "leaders" / moderation team is also full of abrasive individuals with fragile egos.
This is just false. You can see Araq answering the noob questions on the forum all the time. He might be not the best person to do that, because his answers on the short side. I believe, noobs often need more context, examples and explanations than he's providing. But it's thought and effort that counts. Some people even hate when you treat them as complete beginner and try to nourture them common CS knowledge.
Araq has opinions that he defends, but you can and absolutely should try to sway or change them. I see this all the time on Discord and Forum. And I see people win over just as much as them losing.
I don't have a strong opinion if this is healthy or not, but it's probably why I would be a bad BDFL =). All in all, I don't think dictatorship is a right word here.
Outside of the Western market, installing Android apps not from Google Play is a completely normal and regular thing. In countries like India, Brazil, Indonesia, Nigeria, and the Philippines (which represent a massive portion of global Android users) it is a standard part of using a phone.
I'd guesstimate that close to 50% of Android users know how to install an apk.
It was ported[0] by enthusiasts to literary almost every Android phone. I have it on my $100 Xiaomi.
Also, it's not a javascript framework, a stable software doesn't have to update often. Look at Lua, most people still use Lua 5.1 and that was released in 2006.
> Wouldn't be surprised if this leads to a lawsuit over monopolistic behavior
His reaction also matters because he's basically the public face for the company on YouTube and has a huge following. You've probably seen a bunch of social media accounts with the "clippy" character as their avatar. That's a movement started by Louis Rossman.
Who upvotes this?
Too much noise. And the example is great demonstration for it. It's better than gray parenthesis, but a lot of worse than properly structured and indented sections.
- Context Highlighting
Love it. But once again - too much noise for text colors. Just highlight line numbers of nesting level your cursor is in. Indent-blankline[1] plugin for neovim does this (with use of treesitter), but it highlights the virtual indentation lines.
[1] https://github.com/lukas-reineke/indent-blankline.nvim
- Import highlighting
I think it's impractical, because imports are often grouped together at the start of file, but symbols are all over the place and you'd only see highlight on very short files.
LSP "goto definition" is already a better fit here, a bit more immediate solution is to display namespace/import path in status bar. No idea if there's any plugins for this, but should be easy to hack together in an hour.
- Argument Highlighting
Kinda useful, but also gets less useful for longer functions. IMHO doesn't worth it to add whole extra color to a limited palette or it might turn into in-cohesive mess rather quickly.
- Type Highlighting
Could be taken one step further and highlight atomic types in lighter shade and more complex types (not only lists) in darker shade.
nit: example being Python feels a bit out of place here
- Exception Highlighting
LSP virtual text
We should strive to write better software that is faster, smaller and more resilient.
"Storage is cheap" is a bad mentality. This way of thinking is why software only gets worse with time: let's have a 400mb binary, let's use javascript for everything, who needs optimization - just buy top of the shelf super computer. And it's why terabytes of storage might not be enough soon.
If you appreciate Modula's design, take a look at Nim[1].
I remember reading the Wikipedia page for Modula-3[2] and thinking "huh, that's just like Nim" in every other section.
For private repos there is Forgejo, Gitea and Gitlab.
For open-source: Codeberg
Yes, it'll make projects harder to discover, because you can't assume that "everything is on github" anymore. But it is a small price to pay for dignity.
The trickiest part was the AES layer. I had to reach for the C FFI to use OpenSSL for decoding. And it took longer than expected to search instructions for key unwrapping.
Full solution[2] runs in under 20ms on two decade old Intel Xeon, which says more about Nim's performance than my coding skills.
There is also Linux Deploy[1] that automates the process of setting up chroot, ssh and even gui desktop (through framebuffer).
Is it really free, though? You get free service - MS gets everyone's code for free. Only a fool would believe that they don't use private repos for training.
And even if it was free, do you really believe it is sustainable to just offer unlimited service for free to anyone? They've created an environment where you're punished for using anything but github. This is not good.
Codeberg has free Forgejo Actions instance that you can use without a request, but with limited resources[1]:
> own runner is probably more expensive than GitHub
You can rent a VPS for as cheap as $15/year or run it locally.
If a person really cares about your project and wants to improve it and not just boost their own GH stats - creating an account takes no time or they can always send you patches via email.
- syntax that focuses on readability
- automatic memory management without GC overhead (ARC)
- batteries included stdlib
- fast to compile and execute, small binaries
- reduced boilerplate (thanks to templates and macros)
- very easy cross-compilation (thanks to zigcc)
- small but welcoming community, not full of zealots
I can imagine if they've added rate-limiting, e.g. 30GB per IP per week - that would've reduced amount of crap, literal white noise and spam/scam videos uploaded to Youtube in several magnitudes. Another strategy is, if a video doesn't get 1000 views after a week - it's deleted.
You can write games in Lua, Moonscript, Javascript, Ruby, Wren, Fennel, Squirrel, Janet and even Python.
Or use anything that compiles to WASM. I've recently created my own bindings and a template for building Tic-80 games in Nim[1]
You don't have to do this manually every time, just make a shell script with multiple commands; e.g. this will import code, save and run the cartridge:
./tic80 --skip --fs="$PWD" --cmd="load cart.tic & import code main.lua & save & run
The other way is indeed to buy or build yourself a PRO version, it can work with cartridges in plaintext format.Could've been a shell script[2]
[1] https://github.com/zikani03/git-down/blob/cb2763020edc81e464...