9 ms·
Advanced programming languages
- colomon 16y agoAmusingly enough, I tried to sell two of the books he pictures there at my garage sale last weekend...
- terra_t 16y agoSome thoughts. The people I know who do work in machine learning (Jon Kleinberg, Thorsten Joachims, and their students) work in straight-up C, not Haskell, as the author suggests. Most of the dominant methods used today, such as the SVM, boosting, and the dynamic programming methods used in genomics are (i) numerical more than symbolic and (ii) involve moving a LOT of data around, so you want control of your data structures. (Sometimes these guys compress in-memory pointers!) I looked long and hard at Scala and decided that I didn't like what I saw. One problem is that, based on the JVM, type erasure is a big "broken window" that seriously damages the Scala type system. You can use generics for ~years~ in Java and never notice the problems that type erasure causes, but I find that 2/3 of the designs that I specifically want an advanced type system for do not work in Scala because of type erasure. Another issue with Scala is that the interface with Java, particularly using collections, is awkward; people who want to work in the JVM but want concision might be happier with Groovy. Scala's Lispy-Lists are convenient for the pattern matching capabilities in Scala, but are much less efficient than the vector-based Lists that come with Java when your data gets big. As for oCaml, the real excitement is in F#. You get the wonderful oCaml language and all of its features, plus you get an interface to the C#/.NET world that's much nicer than Scala's interface to the JVM. You've got access to the whole .NET framework base class library, plus all sorts of stuff that's been written for .NET. I'd also put C# on the border between a "mainstream" and "advanced" language. C#'s generics implementation just added support for covariant and contravariant inheritance, which is one of the features that had me interested in Scala. C# has good lambdas, really neat stuff in LINQ, and "expression trees" which offer metaprogramming capabilities above and beyond any static language I've seen. Note that there is a good open source implementation of the .NET framework, Mono, so you can develop in C# and F# and target Linux, MacOS and other platforms.
- Artemidoros 16y agoNote that there is a good open source implementation of the .NET framework, Mono, so you can develop in C# and F# and target Linux, MacOS and other platforms. Is Mono actually usable with F#? The last time I checked (2 months ago) the F# plugin for MonoDevelop didn't work and the questions on how to getting it to work (by various people) went unanswered by the developer. The runtime performance of F# code was shaky at best, the REPL had (on OS X at least) startup times to make it practically useless and without TCO the usefulness of F# really took a hit. Not wanting to bash on Mono or F# (which is my favorite language), but writing production software with this combination is currently not something I would recommend.
- jopamer 16y ago[Disclaimer: I'm a compiler dev working on F# at MSFT.] Performance and user experience on Mono are something we're definitely trying to improve - we spent a fair amount of time trying to make our Mono story better for our 2.0 release, and plan on investing more in this area as we move forward. We can't be everywhere at once, so your feedback is really important here - If you're having problems with our tools on Mono, please let us know via Microsoft Connect or fsbugs@microsoft.com. Also, don't be bashful about filing Mono bugs. So far, they've been really great about responding to any issues that have cropped up. Thanks!
- Artemidoros 16y agoThats awesome! Thanks for sharing. I'll give Mono/F# another spin in the next week and will report problems as suggested by you. Again thanks.
- vigalchin 16y agoHello, On http://github.com/vasili/FSharpBinding is an FSharpBinding that works with MonoDevelop. Please read the README on this web site. I have tested new F# projects and several existing F# projects like Mandelbrot set, Stephen Wolfram's Rule 30, etc. This binding still needs polishing .... working on that with other colleagues. Kind regards, Vasili I. Galchin
- DrSprout 16y ago>[Scheme is] untyped, which makes it ideal for web-based programming and rapid prototyping. Erm... While Scheme can be useful for web and prototyping, it is typed. That's why R5RS requires functions like number->string and so on.
- ekiru 16y agoSome people use "type" exclusively to refer to compile-time entities. By this definition, languages that are commonly referred to as "dynamically-typed" are actually "untyped", because they have only one compile-time type, which is essentially the same as having no types.
- silentbicycle 16y agoThat's confusing weak/strong with static/dynamic typing, though. (A common error.) "What To Know Before Debating Type Systems" (http://www.pphsg.org/cdsmith/types.html http://www.pphsg.org/cdsmith/types.html) is a pretty good introduction to types. Also, while I'm only partway through Benjamin Pierce's _Types and Programming Languages_, it's been quite good so far.
- ekiru 16y agoActually, your link agrees with my explanation: It points out in the "Static and Dynamic Types" section that what is meant by "type" in static type-systems and what is meant by "type" in dynamic type-systems are two very different concepts. From the perspective of someone interested in static "types", dynamically-typed languages don't have types at all.
- Zaak 16y agoSpecifically, this is the definition used in Computer Science research. Unfortunately, the communication between that community and the larger community of programmers is so poor that it was several years after I finished my CS bachelor's degree before I figured out why some people insisted that languages like Python were "untyped".
- 16y ago
- KirinDave 16y agoAnd a strong sell for Scala and no mention of Clojure. It confuses the hell out of me; clojure is fast, mature, and has a OO syntax and model to rival CLOS. It's got built in laziness and te best concurrency primitives I've seen to date (and I was a professional Erlang programmer). What does it take to break into the general public's consciousness? Clearly it's not the parens.
- dpritchett 16y agoScala has Twitter to champion it in business and tech circles as well as creator Odersky's technical university affiliations to appeal to the academic crowd. Clojure has a lot going for it in terms of theory but I don't know that it can claim any of the social proof of Scala. The closest thing I can think of for Clojure is all of Siebel's Lispy interview questions from Coders at Work that lead an underinformed coder to think highly of STM and of Lisps. Edit: Scala apparently predates Clojure by a good four years. The larger mindshare is no surprise in that light. Also it appears to have simple pattern matching and several other things that Alex Payne liked: http://www.slideshare.net/al3x/why-scala-presentation http://www.slideshare.net/al3x/why-scala-presentation
- xtho 16y agoAFAIK the "theory" in clojure also stems from the scala world in that clojure data structures are based on work done for scala or by scala affiliates.
- KirinDave 16y agoNo. All that work predates both, in some cases by several years. In fact, a good friend of mine is working to put scala bindings over all the clojure data structures so they can be used transparently in scala. They're that good.
- Artemidoros 16y agoYour friend might be wasting a lot of effort (apart from his personal learning experience), as Phil Bagwell is working on Scala's collection library.
- barrkel 16y agoI smiled when I read this: Haskell's type system literally allows the compiler to infer the correct code to run based on its type context It literally has overloading! Imagine that!
- ekiru 16y agoHow many other programming languages have a type system that supports overloading on both parameter types and the desired return type?
- barrkel 16y agoLanguages with operator overloads, including typecast ops.
- silentOpen 16y agoMost languages with operator overloads don't have inferred static type-checking woven through them, though.
- barrkel 16y agoOn the contrary, almost all statically typed languages with overloaded operators use type inference to type subexpressions; it's how they do type checking and produce type errors. Type inference for named values, or locations, or functions is one thing; but type inference of expressions is everywhere. If you consider '+' as overloaded on ints, floats etc., even C uses type inference to infer a type for '4 + 0.5'.
- silentOpen 16y agoI don't know if I'd call that "inference" so much as coercion, precedence and propagation. The exciting thing about Haskell type classes is precisely the integration with the type system and its modified HM type inference -- if you don't think the Haskell type system is cool, you probably won't be impressed much by its fairly elegant support for an abstraction that lets you overload operators, perform multidispatch, enforce contracts, and define the very laws of mathematics. Perhaps if you don't know Haskell, you should learn Haskell to understand what the article is saying. Edit: This might help: http://www.haskell.org/tutorial/classes.html http://www.haskell.org/tutorial/classes.html
- raganwald 16y agoIt has been my experience that it is difficult to get a bug passed the Hindley-Milner type system. Amusingly, this typo (passed instead of past) is an example of the challenge facing language and tool developers. We can make a checking system isomorphic to a spell-checking system, but then we need a grammar-checking system to ensure that even if a word is correctly spelled, it forms a legal sentence. Once we have that, we need some sort of logic-checking system to make sure that a word with the correct spelling and the correct grammar is meaningful in the program. And so forth. It's type-checking all the way up.
- chaosmachine 16y agoEven with perfect grammar, spelling, and logic checks, you're still going to lose sometimes: I mistyped a single letter in an email and offended a coworker for life. He was on the road; I was in the office. I argued persuasively about a difference in design, ending with "When you get it, we can talk some more". I had intended to say "When you get in, we can talk some more". http://news.ycombinator.com/item?id=1375231 http://news.ycombinator.com/item?id=1375231
- raganwald 16y agoI once commented on something, intending to say "Uh, have you considered..." But I wrote: Ugh. Have you considered... I had some 'splainin to do!
- chc 16y agoBut that's the thing about Hindley-Milner — most typos and logic errors will result in a different type than the one you intended. You'll get an infinite type or a number where you meant to get a list, etc. There are some bugs that can make it through, but the number of errors the type system can catch is amazing — it's actually close to being a logic checker.
- jheriko 16y agoI'm curious where all the data is about "expressiveness" being so important. I'm yet to meet the person who can churn out functional solutions quicker than imperative... but I hope this is my naivete and not just the CS bandwagon effect.
- jimbokun 16y agoSome data about Lisp vs. Java/C/C++: http://www.norvig.com/java-lisp.html http://www.norvig.com/java-lisp.html Not clear how much is due to the functional nature of Common Lisp, but does show a clear difference between programming languages in expressiveness and productivity.
- T_S_ 16y agoI think haskell is worth watching. If projects like repa and dph are able to deliver parallel performance speedups, then haskell could become a top choice for machine learning and related algorithms. Personally, I have found haskell to be hard to program in initially, but once you get started, refactoring and feature changes feel "easy".
- jk 16y agoConsidering the context, it is amusing to see no mention of arc.