Live data from Hacker News

Advanced programming languages (2009)

matt.might.net

141–150 of 208 posts

Re: Advanced programming languages (2009)

#142

Earlier quoted context omitted.

Web based is because JSON is always easier with dynamic types. Rapid prototyping is because it requires less explicit up front design due to dynamic types. Artificial Intelligence is because metaprogramming is easier in homoiconic languages.

I'm really intrigued by your last point that "Artificial Intelligence is because metaprogramming is easier in homoiconic languages." Can you elaborate on this? Why are or what about homoiconic lnagunages make them more suitable for metaprogramming and AI in general? Thanks

I don't think this is actually true for most of what people do with AI right now. Machine learning these days is something where you want strong, native machine level support for numeric programming on matrices. Possibly with GPU support. So a lisp based language wouldn't really help you much in the current environment.

If what you want is a system that rewrites itself, then you definitely want homoiconicity. It also helps if everything is one big expression.

Let's say you want to write an evolutionary algorithm that rearranges fragments of its code and runs it. More successful functions make it to the new generation. You want LISP for that.

Realistically, you could probably do this on any abstract syntax tree. But the problem is that unless your language is homoiconic, what you get back might not actually be valid in your language. So, homoiconicity gives you bidirectional support for rearranging the AST and still getting something you can read.

It's also just a lot easier to write something that looks at the code and does computation on it when that code is also data.

But, like I said, I'm not sure many people are actually doing this these days. It was popular back in the day. It's not clear that it's the right way to do things.

Re: Advanced programming languages (2009)

#143

Earlier quoted context omitted.

Can you explain how types slow you down for whipping up a proof of concept?

Hitting an API endpoint, pulling data out of a database. Areas that already have an implicit schema require you to explicitly redefine that schema within your application. I say this not just from personal preference, but I've proctored many timed coding challenges that were language agnostic. The challenge involved consuming data from a handful of API endpoints and compiling a response. Most statically typed solutio…

That coding challenge sounds like a far cry from developing even a prototype application. What was the skill level of the people doing it? Had they had experience in both dynamic and static types languages? What were the languages, Java or something modern?

Edit: I don't mean this to be snarky, I just feel that it is not a very good experiment to draw conclusions from.

Re: Advanced programming languages (2009)

#144

Earlier quoted context omitted.

PL theorists - from what I saw, not being one - prefer the term "unityped". It's not true that there are no (static!) types - there is a single, unnamed type which contains all possible values.

PL theorists who know what they are talking about know that this is false, because the actual diverse types of those values can be reasoned about at compile time. Such a "unityped" program is made up of syntax. We can reason about an expression more deeply than just "it returns a value" and we can do so statically. For instance in Lisp we know more about an expression like (cons 1 2) than that it returns a value. We…

It's not false, it's just unspecified. If you hand me scheme I can provide it a unitype system without conflict. If you hand me Haskell I cannot because the language has explicitly said that uncheckable statements are invalid.

You can of course go further with your static analysis—a language may support many type systems in principle regardless of what the compiler accepts.

Re: Advanced programming languages (2009)

#145
post #72

What's up with functional languages nowadays? The exists since the dawn of humanity, but they are getting very trendy lately. Is it just my perception? Is it a HN thing? (I've been a reader for just some months)

Pure FP languages are still pretty niche, but what has happened is the big mainstream languages like C# and Java has adopted more functional features like higher order functions, lambda syntax, increased focus on immutability and so on. So functional languages are clearly trendy among the language designers, from where the inspiration trickle down to the mainstream.

Re: Advanced programming languages (2009)

#146
post #69

Earlier quoted context omitted.

Your first two points are also met by optionally typed languages.

I'd argue that optionally typed languages are dynamically typed. Typescript at runtime is dynamically typed, same with Erlang. Perhaps not always true, but usually the type system provides static analysis which is help but not sufficient to provide guarantees.

Dynamic typing and static typing can coexist in the same language. C# is generally statically typed, but the more recent versions support the dynamic keyword - at which point you're statically typing things to be dynamically typed. Typescript of course goes the other way - adding static typing features to otherwise dynamically typed Javascript.

...the first thing I do when encountering JSON in TypeScript these days is to add type definitions to describe the schema. If I have a hard time describing the schema to TypeScript, I'm going to have an even worse time trying to keep it straight myself.

Re: Advanced programming languages (2009)

#147
post #51

I can't seriously read an article that promotes Scheme over any other languages. We had a class in university and everybody hated it. How can you write complex program with so many parenthesis?

Viaweb used Lisp as their secret weapon, and pg and rtm rolled the money from the Yahoo acquisition into Y Combinator's first classes.

http://www.paulgraham.com/avg.html

Hacker News itself is written in a new Lisp dialect that resembles Scheme.

https://github.com/arclanguage/anarki/blob/master/lib/news.a...

Re: Advanced programming languages (2009)

#148

> It's untyped, which makes it ideal for web-based programming and rapid prototyping. Given its Lisp heritage, Scheme is a natural fit for artificial intelligence. Why does being untyped and having a Lisp heritage make Scheme suitable for these three tasks?

Web based is because JSON is always easier with dynamic types. Rapid prototyping is because it requires less explicit up front design due to dynamic types. Artificial Intelligence is because metaprogramming is easier in homoiconic languages.

   Artificial Intelligence is because 
   metaprogramming is easier in homoiconic 
   languages.
Homoiconicity is something you can add to any language, dynamically or statically typed, simple or complex, it doesn't matter. It used to be belived that only syntactically simple languages like Lisp are suitable for homoiconic extension, but this myth was destroyed by Walid Taha and his development of the MetaML family of languages.

For an overview of how to add homoiconicity to languages, see https://arxiv.org/abs/1602.06568

Re: Advanced programming languages (2009)

#149
post #81

> Scala is a rugged, expressive, strictly superior replacement for Java. Scala is not replacement for Java. It runs on JVM and can invoke java code, but has completely different approach than Java. Use Kotlin if you want Java replacement. Also I would argue that Scala is much better suited for writing compilers than Haskel.

Scala can be a fine Java replacement, if you drop 20% of its features on the floor. As long as you never see a higher-kinded type, I think you are ahead of Kotlin, and the learning curve is not really any different.

The problem with this approach is that 90% of Scala libraries are built by people that live in higher-kinded land, and believe that since they have reached that level of expertise, so should everyone else, the second they start learning the language. For instance, look at SummingBird: The hello world example includes F bounded polymorphism, and path dependent types! Anyone new to the language would run away screaming, and I'd not blame them.

Re: Advanced programming languages (2009)

#150
I am still stuck on why this is titled Advanced Programming Languages. Wait, so anything other than the most widely adopted robust language technologies used in enterprise systems is 'advanced'? Language compilers, interpreters, database engines, and runtime implementations are advanced. Who says, "we need an advanced language for this solution", as opposed to "this problem requires an advanced solution"?
Post reply on HN