6 ms·
I get that everyone would love to have a functional language that's eager by default with optional lazy constructs, great polymorphism, statically typed with in
by didibus 9y ago
I get that everyone would love to have a functional language that's eager by default with optional lazy constructs, great polymorphism, statically typed with inference, generics, great concurrency story, an efficient GC, that compiles quickly to self contained binaries with simple and effective tooling which takes only seconds to setup while giving you perfomance that equals java and can rival C, with a low memory footprint.
But, I don't know of one, and maybe that's because the Go team is right, some tradeoffs need to be made, and they did, and so Go is what it is. You can't add all the other great features you want and eat the Go cake too.
Disclaimer: I'm no language design expert. Just thinking this from the fact that I've yet to hear of such a language.
- Tyr42 9y agoSounds like you want Eager Haskell.
- daww 9y agoyes please
- piinbinary 9y agoIdris is basically an eager-evaluated Haskell, with other niceties on top (dependent types if you want them; fixed String type)
- nightski 9y agoNearly every item on your list is available with OCaml.
- ziotom78 9y agoApart from "great concurrency story", because of the well known problems with the GC. This might be a huge shortcoming for a number of people.
- trishume 9y agoMulticore OCaml is in the works and is looking amazing, but is indeed a ways away. They're taking their time and doing it properly so things are fast and safe.
- oblio 9y agoThe thing is, until it's shipped, it's still vaporware for most people, especially if they want to use it in a commercial setting. KDE 4 was released in 2008 and it was supposed to be ported to Windows. We're in 2017 and KDE 5 is still far from being considered stable on Windows. And I'm sure you can also think of many examples of programs promised and never delivered or underdelivered.
- majewsky 9y ago> was supposed to be ported to Windows It was ported to Windows. I cannot check the remarks about stability because I use Linux, but it sounds plausible. There's only a handful (maybe 2 or 3) developers working on Windows support in their spare-time AFAIK. I would guess that KDE had anticipated more Windows developers joining the project as it progressed towards maturity. That's always the problem with open-source projects: It's very hard to do planning and forecasting with a bunch of volunteers. Even if they commit to a roadmap, there will always be someone who has to step down because of private issues (new job, new child, etc.). Go is in a much better position since Google has headcount assigned to it (again, AFAIK).
- rbehrends 9y agoIt isn't a great concurrency story, but the shortcomings are also overstated. OCaml does message-passing concurrency just fine and allows for shared memory for arrays and matrices of scalars, which is good enough for most scenarios. (Technically, there's also Ocamlnet's multicore library, but that's too low-level for most people.)
- Matthias247 9y agoF# is pretty good there, especially if one uses a library like Hopac. However I think it's still not on the level of Go, since concurrent operations are represented through monadic types (like Job<T>), and so everything has one level of indirection. F# workflow builders ("do notation") makes that somewhat more bearable, but I still think it's harder to work with than just using normal function calls on normal lightweight threads, like available in Go.
- cdelsolar 9y agoExcept no one's ever heard of OCaml.
- pjmlp 9y agoDepends how good their CS degree was.
- spyspy 9y agoA large standard library, too?
- LukaD 9y agoI really enjoy writing OCaml but I hate all the tooling around it. It lacks a good package management and build system à la Cargo.
- abiox 9y agoit's a bummer that the windows story for ocaml is so sketchy. i'd like to use it for work (various utilities and whatnot) but the ecosystem seems to make a lot of assumptions about the system it runs on. (for me there's still haskell and rust at least.)
- spion 9y agoOCaml might become this once multicore happens.
- mhh__ 9y agoWith the possible exception of the GC, d(lang) fits those parameters. Including optional lazyness, performance etc.
- devit 9y agoRust is probably what you are looking for. > a functional language Has closures. Has pattern matching. Has algebraic data types (however variants can't have generic parameters not present on the data type itself, but you can use trait objects to do that). Functions that don't take &mut parameters, & parameters with types with interior mutability and don't call functions that do I/O are pure (although they may not terminate and may abort). > optional lazy constructs "Automatic" lazy costructs are usually unnecessary and thus almost never used, but can be implemented as a library using macros. Can also just use closures and call them explicitly. > great polymorphism Has trait/typeclass polymorphism with either monomorphization or dynamic dispatch. Structures can't be inherited, but composition gives equivalent results and is the proper way to do it. There have been several proposals for inheriting structures though, so maybe it will be available at some point, despite not being advisable. > statically typed with inference Yep. > generics Yup. Not higher kinded, no constant integer parameters and not variadic yet, but those features should be available in the future. > great concurrency story Rust is the only popular language supporting safe concurrency without giving up the ability to share memory between threads. > an efficient GC It turns out that a GC is unnecessary, and that reference counting is enough, which is what Rust provides (although it's still relatively rarely used). If you insist on a tracing GC, there are/have been several attempts to add it, and maybe there will be a mature one in the future. In particular, there is a "rust-gc" crate, and Servo has a working integration with the SpiderMonkey GC, which I suppose should be possible for others to use with some work. > compiles quickly Work in progress (incremental compilation, more parallelization). > self contained binaries Yes (or optionally using shared libraries). > simple and effective tooling which takes only seconds to setup rustup can install the compiler and package manager in one line. If you want an IDE, you'll have to install that too separately. Work in progress on improving IDE functionality and ease of use. > giving you perfomance that equals java and can rival C Performance is at least theoretically the same as C since the generated assembly code is conceptually the same (other than array bounds checking, which can be opted out from with unsafe code). > low memory footprint Same as C.
- XorNot 9y agoHow do you get self-contained binaries with Rust? There's a lot of talk but I've not found a definitive "produces a static library" build guide.
- rbehrends 9y agoHonestly, no. For starters, I don't want a functional language (at least not a purely functional one). Purely functional programming has some distinct downsides. My preferences are firmly on the multiparadigm side, and I'm perfectly happy with a reasonable imperative language (that still supports higher-order functions and closures). What I'm not happy with is language designers seemingly ignoring the state of the art even when it comes to picking low-hanging fruit.
- mmargerum 9y agoSounds like Scala might be what you are looking for if multi paradigm is your thing.
- rbehrends 9y agoThank you, but ... First, I'm not looking for a language. Programming languages are part of my field. I was making an observation rather than expressing a need. If there's a language that's not totally obscure or esoteric, I've probably written some serious code in it at some time. Second, I know and use Scala (among other languages) and have done so since the 1.x versions, but the JVM dependency is too often a problem (and Scala Native is not yet mature).