A few of the main contributors are good friends of mine, so this post might be biased.<p>One of the nicest part of Nit in my opinion is their foreign function interface (FFI). It currently supports C and Java out of the box, and Objective-C and C++ are being worked on. I had the chance to work with the FFI a few years ago when it was still a student's master project, and I really had a blast with it. Some librairies such as libcurl[1], curses[2] and sdl[3] were implemented with this FFI.<p>Another great part of this language is a project being worked on by the same guy that built the FFI, and it's a cross-compiler for mobile applications called Gammit[4]. You write your app in Nit and compile to Java and Objective-C natively for Android and iOS application. The iOS part isn't ready yet, but the Android one is quite advanced with a few great examples such as a small Minecraft clone working with Google Cardboard and having multiplayer functionality.<p>[1] <a href="https://github.com/privat/nit/tree/master/lib/curl" rel="nofollow">https://github.com/privat/nit/tree/master/lib/curl</a><p>[2] <a href="https://github.com/privat/nit/tree/master/lib/curses" rel="nofollow">https://github.com/privat/nit/tree/master/lib/curses</a><p>[3] <a href="https://github.com/privat/nit/tree/master/lib/sdl2" rel="nofollow">https://github.com/privat/nit/tree/master/lib/sdl2</a><p>[4] <a href="https://github.com/xymus/nit/tree/gammit" rel="nofollow">https://github.com/xymus/nit/tree/gammit</a>
Here are my thoughts after quickly glancing over the „features“:<p>1. No formatting rules and verbose „end“<p>I thought that by now it was universally accepted that having clear rules is a good idea, see Python and golang)<p>2. OO with inheritance<p>3. multiple at that<p>4. Dynamic classes/objects<p>5. Methods <i>inside</i> the classes<p>All of these make reasoning about effects very hard/impossible; Interfaces in golang, Multimethods in Clojure, Typeclasses in Haskell, CLOS in CL all provide a better solution to that.<p>6. Imperative<p>7. No functional elements (no functions, only methods)<p>Both mean inherently stateful, which in turn complicates reasoning<p>8. redef & super<p>It’s dangerous to have behaviour of single methods spread all over your codebase.<p>9. nullable<p>Looks like an interesting idea to eliminate the class of NPE runtime errors, yet it’s a special language (and syntax!) construct. It therefore does not arise out of the type system, but is explicitely built into the type system, so it doesn’t scale. See Haskell’s Maybe type on how to eleminate NPE’s with a small, trivial type that is no more special than any other.<p>Take it or leave it, these are the things I learned in my study of programming languages. I might be wrong, I might be right, but these are the things that came up as bad design most often in different languages. /me out
I would appreciate if the home page provides the real incentive behind inventing this language. "a robust statically typed programming language where structure is not a pain" is a bit vague and not a unique thing that hasn't been achieved by other existing languages.<p>My current hunch is something like "let's have a static typed language with Ruby syntax," but I am really not sure.
Examples? Found some.<p><a href="https://github.com/privat/nit/tree/master/examples" rel="nofollow">https://github.com/privat/nit/tree/master/examples</a>
<a href="http://nitlanguage.org/manual/genericity/" rel="nofollow">http://nitlanguage.org/manual/genericity/</a><p>> Unlike many object-oriented languages, generic classes in Nit yield a kind of sub-typing. For example, Pair[Int] is a subtype of Pair[Object].<p>Sounds completely broken. What if Pair[E] is contravariant on E?<p><pre><code> class Pair[E]
fun contains(E): Bool
fun clamp(E): Bool
end
</code></pre>
> <a href="http://nitlanguage.org/refinement/" rel="nofollow">http://nitlanguage.org/refinement/</a>
(redefining any method)<p>That's spooky action at a distance. It breaks modularity, could cause packaging hell.
Looks nice. Some ideas are very similar to those of Crystal ( <a href="http://crystal-lang.org" rel="nofollow">http://crystal-lang.org</a> ) like the automatic type flow. But it seems not to support union types and types are required everywhere (which some might like).
I like that I can start hacking right away after reading the 'not a manual' once.<p>I don't like the 'do' - it's either redundant or inconsistent. Why does 'while' get a 'do' but 'if' doesn't?<p>Or the 'end', especially as it could be a 'while-end' or an 'if-end'.<p>And 'isa' (what was wrong with 'is')? Blech!<p>I like that 'var' is an attribute and the 'fun' is a method.<p>Android support is intriguing.<p>Maybe this seems like small things and I don't know about what the rest of you are talking about. 'contravariant'? huh?<p>But it looks cool to me and I don't think you can ever have too many cool things.
<p><pre><code> for i in [0..width[ do
for j in [0..height[ do
if foo(i, j) then break label outer_loop
# The 'break' breaks the 'for i' loop
end
end label outer_loop
</code></pre>
ouch. I see why mathematicians would like that, but programmers are surely annoyed by the open range "[".
And if the target are mathematicians, they surely dont like the verbose do end blocks, instead of {}.<p>the for loop could be then<p><pre><code> ∀ x in [0..height[:
if foo(i, j): break outer_loop.
</code></pre>
just odd syntax choices.
Glad to see another language that has chosen to avoid NullPointerExceptions. Some of you might take issue with the way it is implemented (special syntax vs general type), but IMO it is still much better than having NPEs.
I was in a class last year, and one of the grad students was working on Nit and gave us a presentation of the language. It was extremely interesting and seemed quite well designed.
The documentation in one big PDF:<p><a href="http://nitlanguage.org/manual/nitreference.pdf" rel="nofollow">http://nitlanguage.org/manual/nitreference.pdf</a>
Altough I like the idea of writing yourself own language for learning purposes and fun, I don't think it's anyhow better than available toolbox.
seeing &lt; and &gt; html escapes here: <a href="http://nitlanguage.org/refinement/" rel="nofollow">http://nitlanguage.org/refinement/</a>
The sales pitch makes it sound like I can have the Java experience without the JVM, with junk like multiple inheritance, using syntax from ALGOL.<p>Where is the "fun" and "painless" and "bug-free" going to come from?