Live data from Hacker News

Advanced programming languages

matt.might.net

31–40 of 82 posts

Re: Advanced programming languages

#31
post #6

Earlier quoted context omitted.

Some 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.

That'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 ) 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.

Actually, 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.

Re: Advanced programming languages

#32
post #6

Earlier quoted context omitted.

Some 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.

It's rather semantic, but I would differentiate typed from untyped by type checking vs. type being an inherent property of a variable. So you have something in Scheme like: (define foo 1) (define bar "1") And that is typed, the former being a number, the latter a string. If you try to subsequently do: (+ foo bar) the program will error out. Contrast this with what I would consider an untyped language like Python or P…

Python is as strongly typed as Scheme; 1+"1" will produce an exception in Python.

Re: Advanced programming languages

#33
post #14
post #3

Some 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 str…

> Another issue with Scala is that the interface with Java, particularly using collections, is awkward; [...] Really? For me one of Scala's best attributes, by far, is the ability to use its implicit conversions to make awkward Java APIs smooth like butter. > One problem is that, based on the JVM, type erasure is a big "broken window" that seriously damages the Scala type system. I'm not sure I understand or agree. U…

Using implicits is really nice to clean up the interface to some Java APIs (especially for APIs making heavy usage of anonymous inner objects) but I experienced more ugly boilerplate than I would like when having to use Java collection classes from Scala, too.

To be more specific, when I want to transform a collection given by a Java library in a functional manner, I usually ended up with one or two localized import statements - to avoid e.g. scala.collection.mutable leaking into my other methods - and additional calls to convert the Java collection into a Scala specific and back again. This doesn't look like a big issue, but it increased the line count for a lot of cases from '1' to 3-5 ... which puts it uncomfortably close to 'dumb for loop territory'.

Admittedly, this is a small price to pay compared to the constant annoyance that is Java, but for my part I fear that there might be a slight tendency in Scala to fix interesting problems preferably to useful ones.

... lost any type information within the scala language at compile or link time...

How about this use case?

match { case x: List[Foo] => ... case x: List[Bar] => ... }

give me Scala any day of the week

Why do you have the preference for Scala? I'm curious because Scala is my language of choice for my personal projects, but I would ditch it the second a credible F# derivative would appear on the JVM (F#'s stronger emphasis on functional programming, cleaner syntax and abstaining from 'fixing typing' in OOP are the reasons for my preferences).

Re: Advanced programming languages

#34
post #20

Earlier quoted context omitted.

AFAIK 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.

No. 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.

Your friend might be wasting a lot of effort (apart from his personal learning experience), as Phil Bagwell is working on Scala's collection library.

Re: Advanced programming languages

#35

Earlier quoted context omitted.

No. 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.

Your friend might be wasting a lot of effort (apart from his personal learning experience), as Phil Bagwell is working on Scala's collection library.

For context to "outsiders": Bagwell wrote the papers that the Clojure datastructures are based on.

Re: Advanced programming languages

#36

It 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 tha…

Even 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

Re: Advanced programming languages

#37

And 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.

I liked the look of Clojure the language, but I got put off a bit by all the Java infrastructure that gets pulled in. For example, not knowing much about Java build tools, I have very little idea what leinigen is actually doing behind the scenes. There's not much documentation, and I didn't have much luck googling for error messages. I'm playing around a bit with Google App Engine, and things got a lot easier when I just gave up and switched over to Python. Having to use any kind of build system feels like a huge waste of time if execution speed is not a top priority. Python might not be quite as nice a language as Clojure, but I just write the code and it works -- no extra fiddling about required.

Re: Advanced programming languages

#38

And 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.

I agree. I have been working on some statistical NLP code in Clojure today for a client and I continue to be amazed at how concise code can be. One of the reasons I starting using Ruby about 5 years ago was that it is such a concise language, but Clojure seems even better. Smaller code is easier to read and maintain.

Re: Advanced programming languages

#39
post #3

Some 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 str…

I was curious if F# is really that close to ocaml, and it seems they are related: http://stackoverflow.com/questions/179492/f-and-ocaml with some differences (eg. F# doesn't seem to have those crazy +. *. etc float operators for type inference).

Here's a ridicuously detailed table comparing F#, ocaml, haskell, scala, ML (ie. everything in the article but scheme), at the aptly named http://hyperpolyglot.wikidot.com/ml

Re: Advanced programming languages

#40
post #37

And 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.

I liked the look of Clojure the language, but I got put off a bit by all the Java infrastructure that gets pulled in. For example, not knowing much about Java build tools, I have very little idea what leinigen is actually doing behind the scenes. There's not much documentation, and I didn't have much luck googling for error messages. I'm playing around a bit with Google App Engine, and things got a lot easier when I…

I think that you are correct about two things: Clojure stack traces and error messages are pretty bad. And, Python is probably the best language for AppEngine because of the small loading request times; with Java I struggle to minimize loading request times (I use objectify-appengine instead of JDO, etc.)
Post reply on HN