6 ms·
Ask HN: Does such a programming language exist?
A language that is simple and readable like Python, is static and strongly typed, supports multi paradigm and leverages multi cores or has non blocking IO.
- Rottweiler 11y agoAnd compiles to machine code. Please.
- vezzy-fnord 11y agoOCaml, with a caveat that it's "or has non-blocking I/O", though ostensibly SMP is on its way.
- woah 11y agoWrong or right, I don't think that most people would consider ocaml simple to read.
- noblethrasher 11y agoI don’t know OCaml, but to the degree that it’s like F#, then it is the case that while it is not easy (at first), it is very simple. I can almost always understand any piece of ML code within a few passes, but that has a vanishingly low chance of happening with C# or VB, both of which I know extremely well. N.B. I am using Rich Hickey’s definition of “simple” from his excellent talk “Simple Made Easy”.
- angersock 11y agoC.
- stkbach 11y ago+1
- aninteger 11y agoNim
- dragonbonheur 11y agoFreeBASIC. It is simple, has OOP features, Strongly typed, it has threads and is compiled.
- setpatchaddress 11y agoNo. I assume by 'simple and readable,' you mean that you want whitespace to be significant. Most languages don't do the Pythonesque 'look! executable pseudocode! (hope you like underscores though!)' thing.
- nailer 11y agoCoffeScript and it's variants too. However they're dynamically typed.
- informatimago 11y agoADA.
- divs1210 11y agoJulia
- dllthomas 11y agoStatically 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...
- RogerL 11y agoAs another poster already said, Ada fulfills all of the requirements, and you can trivially write reusable code in it.
- dllthomas 11y agoI don't know Ada well enough to say. Revisiting, I do think Ada generics are probably powerful enough to allow a large amount of safe reuse. I am most skeptical that it still counts as "simple".
- nailer 11y agoWhy does static typing make it harder to write reusable code?
- dllthomas 11y agoA 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.
- CyberFonic 11y agoHave you looked at Genie? https://wiki.gnome.org/Projects/Genie https://wiki.gnome.org/Projects/Genie
- phantom_oracle 11y agoI think this is as close as it gets in terms of syntax. Only on HN would such a discovery be made of such a language. The others that mention: Go, Nim, Crystal - all have valid bases to say it is "similar", but Python is Python and none of those 3 quite read like this one. Interesting language though and it seems the author is active (with an edit in June 2015).
- _raul 11y agoI think Nim[1] or Crystal[2] may be a good fit. [1] http://nim-lang.org/ http://nim-lang.org/ [2] http://crystal-lang.org/ http://crystal-lang.org/
- runT1ME 11y agoScala! 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) <- ConnectionHelper.gchatConnect(conn, "xmppzExampleClient") (conn, presence) <- conn.sendGet[Presence](Presence(from=Some(myjid), to=Some(tojid), presenceType=Some("probe"))) conn <- conn.send(Message(body=Some(msgtext), to=tojid, from=Some(myjid))) conn <- conn.send(StreamEnd()) } yield conn Each <- is actually an NIO callback that uses a threadpool (so you aren't spawning too many threads). But you don't get the nested craziness of ugly callbacks like you would in python or javascript (for instance). Edit: If you really want whitespace, maybe F#? http://www.tryfsharp.org/ http://www.tryfsharp.org/
- nailer 11y agoMaybe 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'
- runT1ME 11y agoMy 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.
- flippant 11y agoIf 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.
- Immortalin 11y agoGo! func factorial(x int) (result int) { if x == 0 { result = 1; } else { result = x * factorial(x - 1); } return; }
- noblethrasher 11y agoBelieve 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.
- bsummer4 11y agoHaskell is all of these things, though it's library ecosystem has a pretty lengthy learning curve.
- circlespainter 11y agohttp://kotlinlang.org/ http://kotlinlang.org/ with http://docs.paralleluniverse.co/quasar/#preview-quasar-kotlin-actors http://docs.paralleluniverse.co/quasar/#preview-quasar-kotli...
- zhte415 11y agoCOBOL :)
- detrino 11y agoC# is gonna be your best bet.