Live data from Hacker News

Nim Programming Language 0.14.0 released

nim-lang.org

31–40 of 58 posts

Re: Nim Programming Language 0.14.0 released

#31

There are several languages similar to Nim these days, and they're all very exciting. For example, Nim, Rust, D, Go, and probably others I'm forgetting. Does anyone know of some chart that compares them based on their features and priorities? Maybe something in the spirit of https://mobile.twitter.com/nixcraft/status/73938379662612889... but with more areas of comparison and less trying to be funny?

ThoughtWorks has something called "Technology Radar". They prioritise stuff that may or may not shape the future.

As a counterpoint: https://twitter.com/bodil/status/597766837548507136

(I add this not as a refutation, but merely because I found it amusing.)

Re: Nim Programming Language 0.14.0 released

#32

Earlier quoted context omitted.

I agree. I don't get it. It seems no one has actually tried it. What I'm asking is what's the idiomatic approach to debugging this. If I code in Nim and produce C code and then compile and link that... I'm debugging produced C code, which is below Nim in the chain. I have to somehow then see what's up with exact Nim code that produced said C code which got compiled and linked. It's two steps remove with a magic, unex…

Javascript targetting languages have source maps to link back errors at the lower level back to the pre-compiled source. Clojure dealt with the dual nature of errors (clojure exception from java exception) by partitioning messages in sub-groups to facilitates reading.

That's the answer I was looking for. I was unaware of that. I presume Nim provides something like that as well?

Re: Nim Programming Language 0.14.0 released

#33
post #3

I still don't understand how can you (efficiently) debug something like this that compiles to another language?

for gdb it looks like you (as a developer of a language that compiles to c) can use #line directives as a means of source-mapping. [1]

[1] http://ftp.gnu.org/old-gnu/Manuals/gdb/html_chapter/gdb_11.h...

Re: Nim Programming Language 0.14.0 released

#34

Earlier quoted context omitted.

I'll try to give it a go for Rust, Nim, and Go. Rust: Wants to replace C++ as an expressive systems programming language. Syntax derived from C++. Emphasis on const correctness. Makes use of some functional programming concepts. Extensive metaprogramming. No garbage collection by default. Interface based polymorphism. The type system tracks memory ownership helping to prevent some classes of error at the cost of more…

Nim feels higher level to me than Go; can you educate me on how you drew the opposite conclusion? Maybe I'm looking at something wrong.

Just because the garbage collector is optional and the slightly higher emphasis on performance. Also the way it compiles to C. I have using Nim to program a microcontroller on my todo list but I'm not sure how I'd go about doing that in Go. It's weird though because Nim is certainly more expressive than Go is and usually that goes with being higher level.

Re: Nim Programming Language 0.14.0 released

#35
I was just skimming the post and found the redefining of 'using' very surprising. The old 'using' was for callsite reusability and the new one is for declaration. Optimizing for declaration site (which would be so few comparatively) doesn't make sense to me and also for declaration I want full type name and such.

Am I missing something here?

Re: Nim Programming Language 0.14.0 released

#36
I'm using Rust at work because it proved a bit more well suited for our purposes than Nim. However, it's still exciting to see steady progress on Nim; it has some really great and innovative language ideas and I hope its increasing polarity will see those features come to other languages too.

Re: Nim Programming Language 0.14.0 released

#37

Earlier quoted context omitted.

Javascript targetting languages have source maps to link back errors at the lower level back to the pre-compiled source. Clojure dealt with the dual nature of errors (clojure exception from java exception) by partitioning messages in sub-groups to facilitates reading.

That's the answer I was looking for. I was unaware of that. I presume Nim provides something like that as well?

I don't know, I only compiled nim once last year to see what kind of C code would show up. I ran away because there was a lot of expansion.

Re: Nim Programming Language 0.14.0 released

#38

Earlier quoted context omitted.

I'll try to give it a go for Rust, Nim, and Go. Rust: Wants to replace C++ as an expressive systems programming language. Syntax derived from C++. Emphasis on const correctness. Makes use of some functional programming concepts. Extensive metaprogramming. No garbage collection by default. Interface based polymorphism. The type system tracks memory ownership helping to prevent some classes of error at the cost of more…

Nim feels higher level to me than Go; can you educate me on how you drew the opposite conclusion? Maybe I'm looking at something wrong.

For example, You can drop into c types using e.g. cstring and cint. Turn off or direct the gc. Manage memory for individual vars using the {.untracked.} pragma, c_malloc and c_free; easy integration of c libraries for obvious reasons; get pointers to things if you need them with ptr.

Have a look at some of these in the manual. Gc stuff is in the standard library somewhere.

This is an example I used recently: http://forum.nim-lang.org/t/567

Don't think it counts as low level but templates and macros are also pretty powerful if you need them. http://hookrace.net/blog/introduction-to-metaprogramming-in-...

I was drawn to it because it is high level, expressive and safe, but you can turn all this off when you need to and keep those bits contained. I'm using it with opencl.

Can't really comment on rust and have limited exposure to go.

Re: Nim Programming Language 0.14.0 released

#39
post #33
post #3

I still don't understand how can you (efficiently) debug something like this that compiles to another language?

for gdb it looks like you (as a developer of a language that compiles to c) can use #line directives as a means of source-mapping. [1] [1] http://ftp.gnu.org/old-gnu/Manuals/gdb/html_chapter/gdb_11.h...

Nim adds those directives for you with the ``--linedir:on`` switch.

Re: Nim Programming Language 0.14.0 released

#40

Earlier quoted context omitted.

Javascript targetting languages have source maps to link back errors at the lower level back to the pre-compiled source. Clojure dealt with the dual nature of errors (clojure exception from java exception) by partitioning messages in sub-groups to facilitates reading.

That's the answer I was looking for. I was unaware of that. I presume Nim provides something like that as well?

Nim can add #line directives into the generated C source code which map back to the Nim code. GDB can use this information.
Post reply on HN