Hacker News new | ask | show | jobs
by matthiaswh 2066 days ago
Not to harp too much on your nitpick of the syntax, but I'm curious why `#[]` rates as more attractive to you than `{..}`? To me they are equally utilitarian, and I can't figure out why one would be strongly preferable.

That said, I do find the placement of Nim pragmas to be cumbersome, resulting in really long lines or awkward line breaks. I wish we could place the pragma declaration on the line before procedures.

  proc callme(formatstr: cstring) {.exportc: "callMe", varargs.}
1 comments

Haven't used Nim yet but I've used a DSL with that syntax (in anger) - it really sticks out as distracting visual noise since I'm used to curly braces for code blocks and brackets for array/object access. Since the latter are less common in most code, take up far less space, and provide a relatively useless visual signal compared to code blocks, I've learned to tune them out during navigation and light reading, which comes free on demand when adopting a new language. The curly braces, however, draw the eye and often come as annotations on things that share names or structures with what I'm looking for or trying understand or remember, confusing the whole process and causing mental "cache misses," if you will.

I find many of Rust's macros annoying for a similar reason, since they'll often be at the root of a module or function but for various complicated reasons can't have leading expressions - you can't make user macros that look like `macro_rules! your_macro_name {...}` or control flow like `match expr {...}` - so they're in an uncanny valley that's just as distracting.