A Programming Language Underdog
121–130 of 238 posts
Re: A Programming Language Underdog
#122Does it have arbitrary length integers? I've not been able to find any reference to such. Edit: OK, there's a library called "bigints" - it's not clear how "natural" the resulting code will be, but I might experiment.
Try "StInt: A fast and portable stack-based multi-precision integer library in pure Nim" Being stack based and having some nice compile time evaluation features should make it very performant. Here: https://github.com/status-im/nim-stint
Assume I'm not a complete numpty, but are there directions for:
* Download
* Install
* Invoke
... anywhere? I'm not at all familiar with retrieving and installing libraries from git, nor with NIM and how/where to install code. All assistance gratefully received. Pointers to existing detailed instructions also very welcome. I can investigate all this myself with trial-and-error, but if someone's done it before it saves me the time and effort of making all the mistakes again.
Thanks.
Re: A Programming Language Underdog
#123By removing the C standard lib and using a custom linker you can get the Hello World down to 150 bytes. Here is a fun read: https://hookrace.net/blog/nim-binary-size/ .
Other than a sort of ELF golf why would dropping the C lib be useful?
Re: A Programming Language Underdog
#124I find the framing of “no big backers” kind of weird, considering they do have one big backer in a crypto currency startup that is providing the overwhelming majority of its funding. Sure it’s not the big coffers of Google, but it’s concerning that the entire language seemingly depends on the fates and desires of an incredibly volatile field. https://nim-lang.org/sponsors.html
This is a very recent development and it will only serve to accelerate development. But yes, we do have sponsorship now. I don't consider it at the same level as the likes of Google/Mozilla though. If it wasn't for those companies I doubt Rust/Go would be alive today. You've gotta give us some points for our persistence :)
Re: A Programming Language Underdog
#125Earlier quoted context omitted.
To me, braces are simpler and more explicit, but then I drank the C/C++ koolaid. Whitespace is intended for human readability, with spaces and tabs not having any implicitly contradictory meaning. In a whitespace sensitive language, you have to set your text editor to make those invisible characters visible to make certain to only use the correct invisible character, then employ multiple such characters based on the…
I know this has been said before but for me it's as simple as: "Format your code as you would have done anyway but just leave out the curly braces". It reduces rather than increases the number of things I have to think about.
Curly braces make this not an issue an they're visible. I don't want to depend on non-visible characters for behavior, but it's only a personal preference.
Re: A Programming Language Underdog
#126I had tried Nim a few years ago, and I liked it, but I am more of a Lisp or C person. I am trying to learn Zig [1] which is intended to be a C replacement - no GC, manual memory management, but avoiding C's pitfalls. Just recently I have been playing with Terra [2] for low level stuff. I am a fan of underdog languages - J, picolisp, shen, xtlang (extempore). [3,4,5,6] [1] ziglang.org [2] terralang.org [3] jsoftware.c…
If Nim’s compile-to-c is attractive, and you like lisp, how about Chicken Scheme?: https://www.call-cc.org/ What little I’ve done is a pleasure. I like some of Racket’s post-Scheme language features better, but Chicken has a lot of Get Stuff Done libraries (eggs), and compiling a single executable is pretty killer. Racket will bundle up an executable pretty well too, but it’s hard to compete with Scheme -> C -> stati…
So this Chicken code:
(foo)
(bar)
(qux)
gets turned into this C code: foo(bar(qux()))
When it hits the C stack's limit, it resets the stack and unwinds to the beginning, and starts over again. I think it was done this way to allow call/cc to work without having to use setjmp/longjmp.Re: A Programming Language Underdog
#127Re: A Programming Language Underdog
#128Earlier quoted context omitted.
"Julia advocates rejoice, but it’s coming for them too" Why do you say that? The whole point of Julia is to create a language that's similar to Python in ease of development but is natively fast. Do you think it fails at this?
Due to GC Julia will never be as fast as C, C++ or Rust.
Re: A Programming Language Underdog
#129Earlier quoted context omitted.
> It uses whitespace for blocks, like Python. Why is this a con?
It's arguably more error-prone, e.g. Rob Pike justifies Go's decision to use curly braces like so: >Some observers objected to Go's C-like block structure with braces, preferring the use of spaces for indentation, in the style of Python or Haskell. However, we have had extensive experience tracking down build and test failures caused by cross-language builds where a Python snippet embedded in another language, for in…
(Well, given it's Rob Pike and looking at some of his work[1], this time it may well be close to the truth... ;))
Re: A Programming Language Underdog
#130Earlier quoted context omitted.
I like the concept of Nim, as in: fast, statically typed, inferred, compiled etc. but I do not enjoy whitespace-sensitive languages, so am keeping an eye on Crystal more than Nim. If that doesn't bother you, Nim is really neat.
Actually, I'm curious why people don't like white space sensitive languages. I get the tab v space thing, and there are certainly a couple of other down sides, but none of these seem like deal breakers to me. Given that python was the second language I learned, it's possible that I drank the coolaid early and I'm blind to some things that are truly egregious. So the question is: why do folks completely avoid a langua…