Live data from Hacker News

Ask HN: Does such a programming language exist?

news.ycombinator.com

21–30 of 37 posts

Re: Ask HN: Does such a programming language exist?

#21
post #18
post #16

Scala! It's mutli paradigm, it can be very simple to read, has amazing concurrency support and can utilize all the NIO goodies from the JVM. Here's an example of me using it to make multithreaded NIO calls with XMPP: val conn = Connection.create(getConnParams("username", "password")) val result = for { (conn, myjid) Each But you don't get the nested craziness of ugly callbacks like you would in python or javascript (…

Maybe C# or the next release of TypeScript? You'd have asynchronous / await so async IO looks more like regular code than generators. Like Scala though there's still a lot of unnecessary syntax. AFAICT the answer to the parents question is 'No, but this would be good'

My two main languages I work in are C# and Scala. Hands down I prefer the latter. The only pro in the C# column is the fact that Visual Studio is (finally) pretty nice. Otherwise Scala is just better. So much better inference, pattern matching, currying, less syntactic noise, higher kinded types, implicit parameters, etc.

Re: Ask HN: Does such a programming language exist?

#23
post #16

Scala! It's mutli paradigm, it can be very simple to read, has amazing concurrency support and can utilize all the NIO goodies from the JVM. Here's an example of me using it to make multithreaded NIO calls with XMPP: val conn = Connection.create(getConnParams("username", "password")) val result = for { (conn, myjid) Each But you don't get the nested craziness of ugly callbacks like you would in python or javascript (…

If you're coming from Python, you will be shocked by the compile times. However, the type system will likely save you time in the long run.

Re: Ask HN: Does such a programming language exist?

#24
post #17

Statically typed and simple generally means it's pretty hard to actually write reusable code and it's unlikely to "support multi-paradigm" very well. That said, "simple like Python" is an interesting phrase...

Why does static typing make it harder to write reusable code?

A simple type system makes it difficult to express useful invariants that are also flexible enough for the code to be reusable. Static typing makes it easier to write reusable code, provided the type language is sufficiently expressive.

Re: Ask HN: Does such a programming language exist?

#25
Believe it or not, Visual Basic is probably exactly what you want.

You may have already heard many good things about C#, but it turns out that VB is slightly more expressive and elegant than C# (I say this as someone that loves C#, and primarily programs using it along with F#).

Here is what VB offers:

* A syntax that almost looks like pseudo code

* A static type system with a kind of optional typing

* Object-oriented programming (classes, inheritance, ad-hoc polymorphism, etc.)

* Functional programming (closures, lambda expressions, parametric polymorphism (generics), etc.)

* Monad Comprehensions (LINQ)

* Type classes/traits (in the form of implicit conversions to an abstract class -- this is another kind of ad-hoc polymorphism, and something that not even F# can easily do)

* XML Literals

* Support for multicore programming in the form of syntactic sugar for writing asynchronous code in a familiar synchronous style (the `async` and `await` keywords)

* All of the .NET framework

* The Roslyn compiler infrastructure -- instead of the compiler being a black box, you can hook into the compiler pipeline

* It runs everywhere Mono runs.

Re: Ask HN: Does such a programming language exist?

#29
post #17

Earlier quoted context omitted.

Why does static typing make it harder to write reusable code?

A simple type system makes it difficult to express useful invariants that are also flexible enough for the code to be reusable. Static typing makes it easier to write reusable code, provided the type language is sufficiently expressive.

What does invariants mean in this context?
Post reply on HN