Nim 0.13.0 has been released
nim-lang.org
nim-lang.org
Here's the official Nim tutorial: http://nim-lang.org/docs/tut1.html
And here is the very approachable "Nim by Example", which offers a series of short, simple lessons about the main Nim features: https://nim-by-example.github.io/
1 - http://webchat.freenode.net/?channels=nim
2 - http://forum.nim-lang.org/
3 - http://twitter.com/nim_lang
I really wish that this language got more attention. It can fill many of the same holes that Go fills without all the awkward dependency non-management and bad error handling. Similar story for Rust, it's got a lot of similar benefits without an ownership and extent model many people find confusing.
Check out what they're doing. It's quite unusual to see.
VariableName == variable_name == VaRiAbLe_NaMeMy OS of choice for the last 25 years has a case sensitive filesystem, all the programming languages I learned (well, except PHP) are case sensitive, it is too hard to unlearn.
BTW, PHP has weird case sensitivity rules. Case sensitive (both user defined and PHP defined):
* variables
* constants
* array keys
* class properties
* class constants
Case insensitive (both user defined and PHP defined) * functions
* class constructors
* class methods
* keywords and constructs (if, else, null, foreach, echo etc.)In Python there is a convention for naming classes with `CamelCase` and instances with `snake_case`.
I could do that in a case insensitive language, but I can't do this in Nim because it is not only case insensitive, it violates the "principle of least astonishment" by normalizing variable names in a way that makes `FooBar` equivalent to `foo_bar` or `F_o_O_b_A_r`.
If you can't see the trouble with this, I rest my case.
class FooBar(): pass
foo_bar = FooBar()
The equivalent in Nim: type FooBar = object
var foo_bar = FooBar()
Compiles and runs perfectly fine.How can this be the case? Well, the identifier equality rules in Nim have changed a while back, to make the first letter of every identifier case sensitive. So, FooBar == Foo_Bar == Foobar, but fooBar != Foo_Bar.
> Nimrod is a style-insensitive language. This means that it is not case-sensitive and even underscores are ignored: type is a reserved word, and so is TYPE or T_Y_P_E. The idea behind this is that this allows programmers to use their own preferred spelling style and libraries written by different programmers cannot use incompatible conventions.
And you can always just learn another naming convention. That's not hard. Almost every language comes with its own way of naming things. For me - I'm using really a lot of languages at the same time - it's actually helpful because it makes easier to tell which language I'm writing right now...
http://blog.codinghorror.com/the-case-for-case-insensitivity...
Personally I believe code is harder to read than to write, so I favor languages that are easier to read.
Oddly enough, the "we are all consenting adults" attitude works in Python. Most patterns and interfaces are by convention instead of being enforced.
People don't abuse Pythons permissive nature very often, and when they do they are frowned upon by the community. I think such deviations are easier to spot in Python compared to other languages, don't really know why.
I actually would appreciate if someone could provide me one.
I think that I disagree. In general (not all the time, but often), things that look different should be different; allowing them to be treated the same is offering beginners a short-time advantage, while preventing them from making, or even understanding, distinctions that they may want to make in the long term. Imagine, for example, a car where both pedals behave the same, and where the actual function is determined by smart traffic-analysis sensors in the car. It would certainly be easier for beginners, but I imagine that it would produce worse drivers; for example, you couldn't drive anyone else's car.
> would you really want to have two different variables called VariableName and variable_name in scope?
Yes, sometimes! (Not that particular example, but there have definitely been cases when I have wanted variables with the same letters in their names but different capitalisations.)
Case-sensitivity is the opposite though: it's making two things that look the same be different. I could maybe support a rule (or even just a linter) that each variable had to be written in a consistent case throughout the project, but two different variables that differ only in case should definitely be disallowed, IMO.
> It would certainly be easier for beginners, but I imagine that it would produce worse drivers; for example, you couldn't drive anyone else's car.
I don't think people buy their cars on the basis of how easy they make it to drive someone else's car, and nor should they.
No it isn't. fooBar and foo_bar have the same words in them, but they look very different.
I can see why you would say that, but (as my comment suggests) I'm with wtetzner (https://news.ycombinator.com/item?id=10932471) on this one: I think that `variable` and `VARIABLE` look different. I am willing to believe, though, that this may just be a result of my training (as a mathematician); my students often genuinely see no difference between `h` and `H` (as variables), for example, and will interconvert freely.
> I don't think people buy their cars on the basis of how easy they make it to drive someone else's car, and nor should they.
I agree, but people often learn to drive with someone else's car, and I think that's the relevant analogy here.
By the way, it occurred to me several hours later that this sounds a lot like HFS's "case preserving" approach, where case is ignored when matching (so that you cannot have a directory with separate files `a` and `A`), but preserved when displaying (so that a file created as `a` will never display as `A`, and vice versa). I don't want to speak for everyone, but my understanding is that this behaviour is regarded as a wart.
That behaviour's very surprising because it means you can e.g. open a file by name, then check its name, and get a different name from the one you opened it under.
What I'm suggesting is equivalent to: variable names are case-sensitive, but it's an error to ever have two variables in scope that differ only in case (maybe only applied when you actually access one - depends on your views on wildcard imports).
You can write ClassesLikePython and variables_like_python in Nim.
Sometimes people end up having dangerously similar variable names in the same scope, e.g. username and user_name, where an incorrect tab-completion might introduce a bug. Nim would require the developer to choose better names.
proc sameIdentifier(a, b: string): bool =
a[0] == b[0] and
a.replace(re"_|–", "").toLower == b.replace(re"_|–", "").toLower
So, right, looks like it is case sensitive for the first character allowing the same convention from Python. Still, I find it dangerous: m_insensitive == min_sensitiveIf X is 1, "-X" computes "¯1", and "¯X" is ill-formed.
(- 1)
and this: (-1)
Are completely different things (the latter is actually an error). Also in LiveScript ls> (- 2)
[Function]
ls> (-2)
-2
Also in Smalltalk, this: -3. "=> -1"
- 3. "=> Error!!!"
That's off the top of my head, I'm sure there are many other languages with this characteristic. Why would that be a problem? It's just a single (or a couple) parse rules to remember (but you get other benefits from it).EDIT: Derp, that's not true. (- 2) == (-2)
It's a minor wart, and probably never going to be fixed.
EDIT: clarified
Why is the latter an error?
In Common Lisp you can work around this by using a special syntax: `|-1|`, which forces reading the thing inside as a symbol. You can then define functions and call them this way:
(defun |+1| (x) (1+ x))
(|+1| 1) ;; => 2
[1] `1-` too, of course.> `|-1|`
Is there a name for that | operator - if it is one?
EDIT: Ah, the documentation mentions:
> This also means that `-1 is always parsed as prefix operator so code like `0..kArraySize div 2 -1` needs to be changed to `0..kArraySize div 2 - 1`.
What's up, Doc? :)
The Hawker Siddley Nimrods replaced the older Avro Shackeltons that were ultimately derivatives of the Lancaster.
Another language that is worth checking out is myrddin http://eigenstate.org/myrddin/. If you haven't heard of it before, I would describe it as C with generics, type inference and pattern matching.
There is good forum software out there. This thing that Araq wrote in his spare time is not good forum software. It is outright painful to participate in a discussion there.
What would you say should be improved in the forum to make it less painful to use?
But I would cut down on the pagination. 10 comments per page is insane on even small devices. A 70-comment thread (not long even by HN standards) means 10 page jumps. Those really mess with your ability to follow anything.
I've not participated, but if I reply to something, do I then "follow" that thread, so I can get reply notifications?
Will definitely cut down on the pagination. Reply notifications are still not implemented but are on my todo list.
I see no way to keep track of threads I've posted in, or threads I am interested in, or get notifications when people reply. That would be the most important thing. Maybe I'm missing something, because right now I read down the list of subjects for threads I'm interested in, and look for whether the most recent responder is different from who I remember.
Writing forum comments in ReStructuredText is not friendly. Anyone who is not wise to the ways of the forum is going to fail the first time they try to post code, and I still have to look up a ReStructuredText reference, because I never use RST for anything else. Just use GitHub-flavored Markdown, the markup language of least surprise for developers.
As another person responded, reading a thread longer than 10 messages is unnecessarily awkward. The navigation buttons -- which must be used frequently -- are not particularly prominent on a computer screen, and on a phone they're like a millimeter in diameter.
Interface elements are strange. Why is someone's username a link if the page behind it doesn't do anything useful such as list their posts? Why does the timestamp have a dotted line under it? What am I supposed to be able to do with the timestamp? I would expect from other places that it would be a permalink, but it seems to just be nothing.
Since its still not a huge forum, adding notifications would create a lot of overhead and I'm not sure it is that much better than looking for your icon in the threads and using the fact that threads are ordered by most recent posts. At this point it seems unnecessary.
If you have ideas for improving it though you can make a PR: https://github.com/nim-lang/nimforum . Best to discuss on the IRC channel with dom96 and them first though (or on the forum).
I agree it would be nice if it loaded a little more than 10 at a time, but the nav arrows aren't that bad for me.
The Nim community's attempt to write a forum from scratch has left them with a deficient forum, and I've explained some reasons why. I took your request for feedback seriously, so you should take my feedback seriously.
Notifications are indeed on my to do list. As well as a more accessible RST reference, right when you're replying/creating a new thread. The RST syntax on the forum supports the GitHub-flavored ```lang ... ``` code blocks, and many people don't realise that.
Your other points are also valid.
But now let me give you the Nim communities perspective. Why did we decide to write our own forum? Well, for three reasons:
1. The old forum used phpBB which is horrible. When the Nim forum was initially written, the "nice" forum software didn't exist (Discourse).
2. (Kind of a continuation of 1) popular forum software was always spammed to death by bots, because of the software's popularity those bots were far more prevalent. It was our belief that a custom forum would have a lower chance of getting spam, and we are mostly right about that.
3. We want to test Nim. The amount of bugs that the development of the Nim Forum (as well as Jester which the forum uses) uncovered is phenomenal. The Nim forum is also a showcase of what Nim can do, and I think that's important.
What I find puzzling though, is the fact that many of your points could also be said about Hacker News. Hacker News has no notifications, no friendly GitHub-flavored Markdown syntax and also has awkward little buttons (the upvote/downvote on mobile is irritating). Yet it thrives and you yourself use it.
Such a huge opening there for multiple parties. Unfortunately, in my research in figuring out how to do this I found that it's actually fairly difficult to provide CPython2 compatibility.
I do wish Nim the best and hope that it gains traction. More languages, more choices are always better.
Imagine Nim using LCL (Lazarus Component Library) or mseide code.
I think they should rethink it.
The Nim compiler was originally written in Pascal and Araq used this tool to translate it into Nim, so it should work pretty well.