3 ms·
The Nice programming language
- mahmud 18y agoI just skimmed through their manual[1], which by their admission is "under redaction" [2]. Here is what I read from the manual and the tutorial[3]: The language looks like C++ in syntax, which means it should be readable to Java, JS and ActionScript programmers. This is specially true of the class-based OOP they implement, where a class definition lexically encloses all instance variables, except maybe for methods. Nice seems to implement generic-function polymorphism, or multi-methods. Methods can be defined outside the class they act upon, but unlike C++ it doesn't use a scope resolution operator but dispatches on the argument type. [my suspicion is confirmed upon further reading]. It has parametric classes with the same exact ugly syntax of C++ templates. It is strongly and _statically_ typed; the later making it less-nice for people like me. Nice is apparently embedded in Java. But unlike Clojure, it doesn't target the JVM with its own compiler, but seems like a source-to-source translator to actual java code. You can cut and paste java code into the bodies of Nice methods! It has enumerated types, aka enums. They completely don't understand what "variable argument functions" mean. They confuse variable argument length, with optional arguments, with arguments with default values. (at this point I would have thought brushing against Lisp would be a prerequisite for designing programming languages; they betray the Alan Perlis quote in the opening of their manual.) They have some assertion and design-by-contract constructs. The manual says their assertions are just like java's, and give a trite example of displaying an error message when an assertion fails (no hint of first-class conditions here, a la Common Lisp's.) On further reading, their asserts and contract stuff is strictly for "dying"; no means to recover from conditions or how to return to a handling point up the call chain. Their implementation of tuples just looks so horrible; again, would have thought a language designer would know at least one ML dialect, and see how tuples should be done. The arrays are your usual algol arrays. Nothing about adjustable array with fill pointers, a la Common Lisp. Nothing about a type hierarchy that points to arrays being of a sequence type, for example, so you could use sequence operations like LENGTH, INDEX/NTH, SORT, FIND, etc. on various datatypes with the same interface (lists, tuples, arrays, vectors, etc. all satisfy a common denominator of sequence operations; they should be layered.) Look, a masochist can only hurt himself for so long before reading the Nice Manual becomes unbearable. I might have reached my threshold :-P [1] http://nice.sourceforge.net/manual.html http://nice.sourceforge.net/manual.html [2] ibid [3] http://nice.sourceforge.net/language.html http://nice.sourceforge.net/language.html
- rincewind 18y agoNice was meant to be an improvement upon java when it did not have generics. Java 1.5 introduced generics that worked different from Nice's, so Nice became a dead end. Nice also supported a more functional programming style. For example there is syntax for blocks/closures: http://nice.sourceforge.net/manual.html#blockCall http://nice.sourceforge.net/manual.html#blockCall
- 10ren 18y agoThanks for the background. Nice also has multi-methods (late binding by argument type), and a nice discussion of the "Shortcomings of the Visitor pattern" to present it: http://nice.sourceforge.net/visitor.html http://nice.sourceforge.net/visitor.html