Live data from Hacker News

Advanced programming languages

matt.might.net

31–40 of 76 posts

Re: Advanced programming languages

#31
post #17

Earlier quoted context omitted.

I don't know how far over to the functional paradigm arc leans but hacker news is programed in it. I know it's built off common lisp so there is that linage. The naughty dog game studio used a form of lisp in their games starting with Crash Bandicoot until they got purchased by Sony(I think). Though, the language was much more imperative in nature instead of functional. Autocad had autolisp built into it. http://en.w…

> I don't know how far over to the functional paradigm arc leans but hacker news is programed in it. HN doesn't look as an outstanding piece of software.

Can you qualify that statement a bit? There's more to HN than meets the eye.

Re: Advanced programming languages

#32
post #19

What exactly makes these languages "advanced" (as opposed to "complicated" or "difficult")? Or does "advanced" here mean "harder" as in "advanced math"?

Programming language research is a very large and deep field, though a lot of industrial languages are fairly divorced from it. All of these languages have a strong theoretical foundation. This pays off well. One common statement from ML programmers is "If it compiles, then it works."

http://en.wikipedia.org/wiki/Programming_language_theory

Re: Advanced programming languages

#33
post #12

Earlier quoted context omitted.

You can do allot with a database sure but sometimes you want multiple transactions within a single request and data will change between them. You may also take input from other sources than a database such as flat files, web APIs emails etc and need to do a bunch of processing between them. Not to mention if you are using Comet or something where you hold a request open for a long time and push and pull allot of data…

sometimes you want multiple transactions within a single request and data will change between them Is this an issue with race conditions, or with alternating between reading and writing the state during a single request, or both, or something else entirely? You may also take input from other sources than a database This doesn't seem like it should make a difference: you write a function to get the necessary data from…

Is this an issue with race conditions, or with alternating between reading and writing the state during a single request, or both, or something else entirely?

Usually reading and then writing some state followed by waiting briefly to see if another thread will change the same value, if it does use then do something with the new value and return that to the request.

I agree that the processing you do with that data might require some significant rethinking, depending on how it was written/planned out before (sure, state-passing style is always there, though I don't enjoy doing it... really though, I've found that a lot of what I was used to doing imperatively is not all that awkward to do functionally).

Depends on how much more difficult it is , does it just require and adjustment of thinking to a new paradigm or is doing everything harder? I'm thinking of stuff like Haskell Monads here. I admit I have not much functional knowledge beyond some basic scheme so I'm curious about this.

What's the conventional way to do this in an imperative language?

I guess allocate stuff on the heap which other threads can modify, use monitors to control concurrent access.

Re: Advanced programming languages

#34
post #32
post #19

What exactly makes these languages "advanced" (as opposed to "complicated" or "difficult")? Or does "advanced" here mean "harder" as in "advanced math"?

Programming language research is a very large and deep field, though a lot of industrial languages are fairly divorced from it. All of these languages have a strong theoretical foundation. This pays off well. One common statement from ML programmers is "If it compiles, then it works." http://en.wikipedia.org/wiki/Programming_language_theory

>Programming language research is a very large and deep field

I agree with you. But to play devils advocate, if its so large and deep, why do I only hear about Haskell and Scala when language-geeks talk about "advanced" programming languages? Looking at the wikipedia link you provide, there's a list of bullet points by decade: 7 things worthy of a bullet in the 60's, 7 in the 70's, 4 in the 80's, 2 in the 90's and 0 in the 00's and 10's. Has nothing interesting happened lately? Is Haskell as good as it gets?

Re: Advanced programming languages

#35

All the languages he suggests apart from Scala are or are pretty close to being pure functional languages. I'm not convinced that I would be more productive developing say a web app , database app or game using say Haskell rather than Java or Python especially since a large amount of programming is all about state and side effects. I'm not against learning a pure functional language as a way to improve your programmi…

"...especially since a large amount of programming is all about state and side effects." Haskell provides lots of tools for reasoning about and managing side effects; it just doesn't (and, indeed, can't) allow them arbitrarily. In terms of interacting with the outside world—e.g. doing GUI work or interacting with a database—you usually have an effectful 'core' that manages side effects while a slew of pure helper fun…

I agree that you can vastly reduce state is a large number of cases. It just seems strange to write in a purely functional language when there are many languages out there that combine functional style with the ability to write in an imperative way.

I can quite happily write programs in python without any real side effects, indeed as you suggest I usually try and divide my functions between those which have side effects and those which don't. So what advantage would I get for picking haskell instead? Other than marginally shorter programs?

FP seems to be picking up steam recently, is this just because we are doing more computation in the cloud and CPUs are getting more cores rather than more raw clock speed or am I missing something?

Re: Advanced programming languages

#36
>In academic research and in entrepreneurship, you need to multiply your effectiveness as a programmer, and since you (probably) won't be working with an entrenched code base, you are free to use whatever language best suits the task at hand.

I disagree. If you're a startup, you're better off using a more mainstream language. I'm from India and if I start to find a good Haskell or Scala programmer I'll be looking for a long time and I'll be paying him/her a lot for those skills. Being a startup, you start small and its tempting to start using the bleeding edge technologies, but you must do a cost-benefit analysis; coders for PHP and Java are much easier to find and since the supply is more, the cost of skills will be less.

Bootstrapped startups should particularly be wary of using technologies that have a very small talent pool in their part of the world. Use new/rare technologies if the benefits of using them outweigh the hassle and expenses of maintaining and extending the team/codebase for it.

Re: Advanced programming languages

#37

Earlier quoted context omitted.

"...especially since a large amount of programming is all about state and side effects." Haskell provides lots of tools for reasoning about and managing side effects; it just doesn't (and, indeed, can't) allow them arbitrarily. In terms of interacting with the outside world—e.g. doing GUI work or interacting with a database—you usually have an effectful 'core' that manages side effects while a slew of pure helper fun…

I agree that you can vastly reduce state is a large number of cases. It just seems strange to write in a purely functional language when there are many languages out there that combine functional style with the ability to write in an imperative way. I can quite happily write programs in python without any real side effects, indeed as you suggest I usually try and divide my functions between those which have side effe…

The advantage is that you can reason about the correctness of code. Sure, if you write an entire code base depending on its size you may be able to reason about all the side effects in your head. But when moving to a larger project, or one developed by a team - all bets are off. It is really important to have the effects embedded in the type system. Even with a large test suite.

On top of this, having professionally written C/C++ for years in the embedded systems space I can say that Monads for IO is not awkward. In fact, it feels far more powerful because you are not limited to the awful semicolon operator for chaining effects.

Lastly FP != slower (even on single core). I agree Haskell can be hard to reason about performance wise at times due to choosing lazy by default. However, have you ever heard of Sisal? Many strict by default FP languages are quite fast, however they sacrifice purity. But to be honest, with experience Haskell can be damn fast also.

Re: Advanced programming languages

#38
post #34
post #32

Earlier quoted context omitted.

Programming language research is a very large and deep field, though a lot of industrial languages are fairly divorced from it. All of these languages have a strong theoretical foundation. This pays off well. One common statement from ML programmers is "If it compiles, then it works." http://en.wikipedia.org/wiki/Programming_language_theory

>Programming language research is a very large and deep field I agree with you. But to play devils advocate, if its so large and deep, why do I only hear about Haskell and Scala when language-geeks talk about "advanced" programming languages? Looking at the wikipedia link you provide, there's a list of bullet points by decade: 7 things worthy of a bullet in the 60's, 7 in the 70's, 4 in the 80's, 2 in the 90's and 0…

No, it is not. The deeper I get into Haskell, the more references I find to esoteric research languages like Agda (which itself is still pretty big compared to many others). The thing about Haskell is that it is probably the most "researchy" language that is also practical to use for general purpose programming.

Re: Advanced programming languages

#40
post #34
post #32

Earlier quoted context omitted.

Programming language research is a very large and deep field, though a lot of industrial languages are fairly divorced from it. All of these languages have a strong theoretical foundation. This pays off well. One common statement from ML programmers is "If it compiles, then it works." http://en.wikipedia.org/wiki/Programming_language_theory

>Programming language research is a very large and deep field I agree with you. But to play devils advocate, if its so large and deep, why do I only hear about Haskell and Scala when language-geeks talk about "advanced" programming languages? Looking at the wikipedia link you provide, there's a list of bullet points by decade: 7 things worthy of a bullet in the 60's, 7 in the 70's, 4 in the 80's, 2 in the 90's and 0…

"Is Haskell as good as it gets?"

It's debatable just how good Haskell and similar languages are. Like any language, it has its ardent fans and bitter detractors.

As for development of "advanced programming languages" in general, if you are interested in what's out there, I strongly recommend you browse the archives of the "Lambda the Ultimate" weblog:

http://lambda-the-ultimate.org/

There are a lot of very knowledgeable language designers on there, and news of advanced language features and new languages filters through there all the time. The blog is not as active as it once was, but the archives are still very much worth studying.

Another great resource is the old c2 wiki. Here are some relevant starting points:

http://c2.com/cgi/wiki?search=haskell

http://c2.com/cgi/wiki?search=lisp

http://c2.com/cgi/wiki?search=scheme

Finally, just hang around HN for a while, and you'll see plenty of posts discussing new "advanced" languages. The HN archives are also worth browsing through.

Post reply on HN