6 ms·
Advanced programming languages
- wewyor 16y agoPrevious discussion: http://news.ycombinator.com/item?id=992218 http://news.ycombinator.com/item?id=992218 http://news.ycombinator.com/item?id=1374635 http://news.ycombinator.com/item?id=1374635
- edw 16y agoJust the mention of Scheme, my favorite programming language, makes me get irritated when I think about the thousand or fifteen hundred lines of JavaScript I've written in the last couple weeks. I'm basically writing Scheme using C syntax, and the anonymous functions as arguments to functions which are called by anonymous functions that are themselves arguments to functions really start to get confusing, in large part because the mixing of parentheses and curly brackets and the semicolons and all the things that are supposed to be the sane alternative to all those sets of parantheses. Oh, and let's not even mention the way JavaScript doesn't do block scoping the way C++ does, and let's not even think about how closures interact with mutation—which almost guarantees that code with for loops and closures will have bugs in it. And the sad thing is, I don't mind writing JavaScript. Relatively speaking, I love JavaScript. Now, if a framework-platform like Node.js existed for Clojure, now, that would be a different story. Except that I'd then constantly have to do mental context switches whenever I jumped from client to server code. There is no rest for the wicked, I suppose.
- tkahn6 16y agoHave you heard of CoffeeScript? It makes writing JS a much, much more pleasant experience.
- edw 16y agoThanks; I just checked it out and while it has some nice features, it doesn't do all that much to compact my already-dense JS. Additionally, the added complexity it introduces to the development process negates some of its charm, as does the extra cognitive load of playing human backtracking parser whenever I have to think about what function applications require parens and which don't. (This is all IMO, so while I think I've accurately portrayed CoffeeScript, YMMV, so people should check it for themselves.)
- tkahn6 16y ago> function applications require parens and which don't. Yes. An understanding of JS is definitely necessary when developing with CoffeeScript. The ambiguity that the parser allows sometimes leads to code generation that isn't at all what you intended. I sometimes find myself going into the JS output to make sure the compiler did what I intended. Annoying, but at least for me, the benefits of cleanliness and things like list comprehensions and Python-esque list semantics makes it worthwhile.
- ataggart 16y ago>Now, if a framework-platform like Node.js existed for Clojure, now, that would be a different story. What about aleph? http://github.com/ztellman/aleph http://github.com/ztellman/aleph
- pmjordan 16y agoThere's also Saturnine, https://github.com/texodus/saturnine https://github.com/texodus/saturnine though I haven't tried it yet.
- sjs 16y agoSibilant is Lisp lipstick for JavaScript. https://github.com/jbr/sibilant https://github.com/jbr/sibilant
- muyuu 16y agoThe guys at INRIA (you may know them from Bigloo or OCaml) have a scheme to javascript compiler that works quite well. HOP is made with that. This short paper: http://www-sop.inria.fr/indes/scheme2js/files/icfp2006.pdf http://www-sop.inria.fr/indes/scheme2js/files/icfp2006.pdf elaborates on Scheme to JS compilation and goes beyond. You can actually generate all the HTML in Scheme as well (as done in HOP). If you download HOP's sources, it's there.
- ahrjay 16y agoBlock scoping is part of ES5 using let https://developer.mozilla.org/en/JavaScript/Reference/Statements/let https://developer.mozilla.org/en/JavaScript/Reference/Statem...
- russellallen 16y agoIf he thinks that Smalltalk is a "alternate yet fully capable universe that branched off from mainstream computing long ago" then I'm not sure I want to know what he thinks about selflanguage.org ... But seriously, his four 'advanced programming languages' seem to be all in the functional space. That's great, but I'd recommend looking outside that as well. Maybe Haskell, Pharo, Factor and Erlang?
- mahmud 16y agoSECONDED! Add Mozart/Oz to the mix for good measure.
- jefffoster 16y ago+1 for Mozart/Oz. It's a great language for exploring the various paradigms of programming. Working through "Concepts, Techniques and and Models of Computer Programming" (http://www.info.ucl.ac.be/~pvr/book.html http://www.info.ucl.ac.be/~pvr/book.html) with Mozart/Oz gives a great tour of programming techniques and manages to stay in one language for the whole journey.
- plastics 16y agoOr AliceML, its Hindley–Milner typed cousin.
- swannodette 16y agoHe does mentions Haskell. Pharo is Smalltalk. Erlang is functional.
- gloob 16y agoThough, in fairness, Erlang has a completely different emphasis than most other functional languages - instead of provability, experimenting with type systems, or state-phobia, my understanding is that it was pretty much engineered for making stable systems, and everything else is a secondary concern. (It was also put together by a telecom, rather than academics or hobbyists).
- joelburget 16y agoI was really surprised when I got to college and the only languages people cared about were C++ and Java. Ok, you'll also find some C#, Python, and Ruby, but nobody has heard of any of these "advanced" languages. The only thing they care about are the number of job opportunities they can get. I sometimes try to advocate for Haskell, or Scheme, or even Prolog. The response is usually "Pascal?" It's sad that these students never wonder if there's a better language, or a more fun language, or anything other than Java. It's a desert out here.
- necubi 16y agoI guess it really depends on what college. At my school, which tends towards the theoretical, Scheme, SML and Prolog are part of the core curriculum.
- joelburget 16y agoI've been reading some blog posts here http://existentialtype.wordpress.com/ http://existentialtype.wordpress.com/ about the curriculum at Carnegie Mellon and I've been very impressed. I can't believe they're phasing out object-oriented programming! Here the faculty seem to think object-oriented is the only way. Actually I can't think of any functional programming we've been introduced to. (Or any other paradigm for that matter)
- leegao 16y agoo_O I don't know about you guys, but our CS affiliation requirement includes at least one semester of Functional Programming (using ML rather than Haskell, I know for sure that CMU (ML) and Berkeley (Scheme/ML) have similar requirements too). Java's seen as the bane of the world over here, especially since none of our professors are convinced that OO is more than just a little bit of syntax sugar coated over some generic imperative language (and as far as I can tell, I'm starting to agree with them).
- plastics 16y agoAFAIK it is pretty common for most universities in Germany to start CS programs with either (S)ML, OCaml, Haskell or any combination of these depending upon the individual preferences of the responsible chair. Java is (was?) pretty common for introductory OO classes. Advanced OO classes (outside of a "Software Engineering" context) though often introduce Eiffel, Smalltalk, Python, C++ and C# as well. Depending upon your particular choice of courses, specialization etc., being exposed to Lisp, Prolog, Perl, C and R isn't uncommon either and from what I heard Scala is also starting to appear as a teaching language. From what I heard the curriculum in France, Swiss, Austria and Denmark is very similar. So I am a bit surprised of the notion that there are universities out there where you can get a CS degree without being exposed to some functional programming.
- kragen 16y agoShouldn't an article on "advanced programming languages" include at least one dependently typed language? I mean, I'm pretty slow and halting in Haskell and Erlang, but with ATS and Coq I don't even know where to start.
- jbooth 16y agoStopped reading at "once a program compiles [in haskell], it's almost certainly correct". Haven't done any Haskell coding, but I just seriously doubt that in any language.
- silentbicycle 16y agoHow's stopping reading at the first thing that challenges your assumptions working for you?
- herdrick 16y agoPlease be nice. jbooth, if you try Haskell out you'll be very surprised. It's often true - it's just that it takes a lot more work to get a Haskell program to compile.
- silentbicycle 16y agoYou're right - I should have been more critical of the comment, rather than making it personal. I agree with the sentiment that often, "once it compiles, it's correct", but people don't stress what Matt Might does enough: "In fact, experienced programmers become adept at encoding correctness constraints directly into the Haskell type system." If you just write Haskell (OCaml, etc.) like you would Python, it's not going to make much difference - it's all about representing higher-level assumptions at the type level, and many people new to H-M languages don't know how to do that effectively.
- jbooth 16y ago* Bugs in the spec * Bugs in underlying system calls * I/O error handling * String processing (if you want to tell me how a type system prevents string processing bugs, I'd love to hear it) There's no such thing as a magic bullet, and the claim is way overstated. It might be less prone to bugs than loosely typed systems, that's something I'd have no problem believing. I'm a fan of strong typing myself.
- DarkShikari 16y ago
- herdrick 16y ago... the Racket library is immense... It is very impressive by the standards of relatively unpopular languages. Also the documentation is really good. But if Racket's libraries are immense, what is Ruby's and Rails'? Mega gargantuan?
- nitrogen 16y agoI went to the U of U for a time, and I wish I would've encountered Matt Might while I was there (it looks like our only overlap would've been Spring 2009, though). Somehow I wasn't able to effectively communicate with my advisor and/or figure out which classes on the schedule were actually cool.
- calpaterson 16y ago"In Haskell, programmers not yet well versed in functional program design may find they repeatedly code themselves into a corner, where they don't have access to the monad that they need. The MLs keep the side effects "escape hatch" open to patch over incomplete design, which prevents projects from coming to a sudden, unexpected "refactor-or-abort" decision point." When I was a beginner, I did this a lot. In fact, I still do it occasionally.