Mio: A High-Performance Multicore IO Manager for GHC [pdf]
haskell.cs.yale.edu
haskell.cs.yale.edu
see e.g. http://research.microsoft.com/en-us/um/people/simonpj/papers...
Given that you already know this, I assume you must be talking about strict functional languages specifically.
There's also the wikipedia page on Substructural Types [2].
(Sadly even that doesn't mean a truly pauseless garbage collector - the "heap of non-referentially transparent objects" will still eventually fragment to the point of filling up)
From https://plus.google.com/u/0/111990768169655655719/posts/Se5e...
> Cabal is a package manager that by default compiles packages either to a system database (if invoked as root/admin) or a per-user database. Since Haskell code is very often fussy about exact version numbers, and because Cabal offers essentially no way to uninstall packages, this is very painful. Cabal-dev is a front-end to Cabal that gives you per-directory repositories: suddenly conflicts go away, and you can remove packages by deleting the directory's repository and reinstalling everything again. It's a kludge, but it is very helpful.
Cabal-dev: https://github.com/creswick/cabal-dev
---Postscript
Or in stronger terms: http://comments.gmane.org/gmane.comp.lang.haskell.libraries/...
> I would say, "You should never mutate your user or global package database" and recommend using cabal-dev. The way cabal-install does destructive updates is evil. In particular, it likes to mutate your global or user package database. You run the risk of building something and then breaking it later by mutating its dependencies.
https://github.com/byrongibson/scripts/blob/master/install/h...
Tons of advantages to doing it that way, including the ability to easily maintain multiple versions of both GHC and Platform on the same system and swap between them with a single command. Also doesn't clutter up /usr/local/ with binaries not managed by apt or dpkg.
More generally, update-alternatives is a godsend for Stable users. It's like RVM or RBENV in the Ruby world - lets you install and manage multiple versions of the same platform and easily swap between them with a single command, including the system version from repos if you want. It frees you from out of date software in the repos while still providing a system to manage the complexities of it all.
There is, however, a lot of research about implementation going on using other languages as well. Most GC research, for example, is done using JVM and Java programs. For this particular paper, it would be really hard to choose a different platform, though, because GHC is one of the rare industrial runtimes that offer lightweight threads.
BTW, Java has lightweight threads, too: https://github.com/puniverse/quasar (I'm the main author)
As far as I see you still use the same, standard JVM threads everyone uses, combined with a thread pool.
What am I missing?
Looking into the actual source code didn't reveal anything “special” either, so I'll just call bullshit on these claims.
Feel free to prove me wrong.
OO subtyping is hard to reason about formally in formal systems designed for FP...news at 11! I jest.
The reason FP does so well academically is that no one knows how to rigorously evaluate something that isn't theoretical (since FP is close to math anyways) or performance-based (most other PL work).
The Haskell crowd is also very creative so they do a lot of cool stuff. However, many of their ideas are transferrable to other languages without the FP ideology.
The OO people have something to offer also, but we've been kind of muted lately.
Well. Even systems like L2 (which are not functional) find subtyping difficult. It becomes difficult in the presence of overloading and overriding.
But the main problem with subtyping, nominative or structural, is how it messes up Hindley-Damas-Milner style type inference. But that shouldn't be surprising that an FP theory for type inference wouldn't work well for OOP.
OO/subtyping is NOT orthogonal to functional, nor is it inherently at odds with formal reasoning. OCaml has both imperative and functional objects; Haskell, Mercury, and Coq (a formal logic language) all support typeclasses, which subsume most of OO and provide subtyping.
Additionally, strong typing has little to do with formal reasoning as well (see: Lisp/Scheme/the lambda calculus). What makes functional languages amenable to formal methods is that they are functional and therefore referentially transparent. Mathematical proofs carry no implicit concept of "state"; hence if you are trying to prove anything about code in, say, C, you need to augment the code with explicit state and remove all non-local effects. (See: the Why language, which attempts to bridge this gap.)
Algebraic/generalized-algebraic type constructors used by most functional languages don't hurt either, as they allow programs to construct complex terms without relying on lower-level stateful abstractions such as memory allocation.
Actually, you just need to augment your model with notions of state, which is standard in operational semantics. It can just be harder to prove things in a complex model, so theorists prefer simplification when possible.
FPL research: Ok, we have this cool way to describe our computation. But how can we efficiently map this to the HW? In essence build a nice language and find an implementation.
Imperative PL research: Ok, we have this HW, how can we build an expressive PL on top of it? In essence build an implementation (the HW) and find a language.
The two language schools you describe seem to be asking whether it is time (whether we have enough capacity) to simply float a new more mathematical world view on top of it all, or whether we should continue to play toward the strengths of the commodity hardware stack.
I personally think that something like Go works for my mind, and the hardware. (I will go make coffee now, rather than "define coffee" and wait for it to appear ;-)
Most really low level code generation and parsing research etc. will apply across the board or at least cover a wide range of type of languages (e.g. register allocation, instruction selection).
But consider type theory - a language like Haskell providers a lot wider scope for research in that area than e.g. C. Or garbage collection - admittedly that's more widely applicable, but many FP languages throw an extra factor into the mix with immutable variables. Etc.
But there's certainly other PL research as well. E.g. all the work that's gone into Javascript compilers in the last few years. Trace trees came out of work done on a JVM for example.
There's still active research in Fortran i.e. for super computers etc., check out the SIGPLAN Fortran Forum [1]. OOPSLA/SPLASH has lots of non-functional language research [2].
Also check out PLDI, arguably one of the most prestigious PL conferences. Scala, Dart, and LLVM feature in their tutorials section [3].
[1] http://dl.acm.org/citation.cfm?id=J286 [2] http://splashcon.org/2012/program/oopsla-research-papers [3] http://pldi2013.ucombinator.org/tutorials.html
<body><center><table border=0 cellpadding=0 cellspacing=0 width="85%" bgcolor=#f6f6ef>
The state is not event-based in nature but does exist.
compile :: Source -> Core
optimizer :: Core -> Core
nativeCode :: Core -> AssemblyAlso, how does one encode iterative computation, like a data-flow analysis, in Haskell? And symbol tables? Is it sufficient that the symbol table is encapsulated within compile even if it involves dictionary read/writes? I'm genuinely curious.
type SymbolTable = Map String Symbol
Me and a codeveloper are working on a type system in Haskell, where our current code has iterative computation, until it reaches a fixpoint.Here's the iterative code:
https://github.com/Peaker/lamdu/blob/master/Lamdu/Data/Expre...
If you need to internally carry state, you just use a State monad to thread around the state purely.
Functional programming languages have mechanisms that make this process pure, simple, and efficient and you get the benefits of never mutating an existing value (which is important when several different functions may hold a reference to it, among other reasons).
See also: The Haskell state monad or lenses. Theses are pure mechanisms that Haskell provides to update state without mutating any data.
Edit: In the event that you do need shared mutable state, the Haskell STM (Shared Transactional Memory) monad is your answer.
I would hope one wouldn't need to resort to STM for a compiler, especially since retry is fairly undefined! Still nothing about iterative computation however, I wonder how the ST monad would deal with a Y combinator?
Logic ~ Type theory ~ Functional programming
That's like asking why algebra is preferred among mathematicians over randomly pushing operators and parentheses around hoping that it will work this time.
One thing I'm surprised no one has mentioned is that they found a race condition in epoll that's existed since version 2.4 of the linux kernel.
And high concurrency tends to break MySQL easily. DB is always the bottleneck here, always.
If you wanted data resiliency, you used RAID60 or RAID10 or some exotic variant that would usually give you on the order of a 30-50% reduction in capacity and sometimes as much as a 75% reduction in write IOPS - it's always been the writes that have been killer, that's the stuff you need to make sure persists. RAID6 with a crappy controller or on an overloaded good controller would make you pay the write hole tax.
Commodity SSDs give you up to, if you're willing to take peak numbers, on the order of 45,000 IOPS. To get to that kind of performance in the last decade, you'd need a cabinet with between 200 and 400 2.5" HDDs, depending on everything involved.
Now, that's all 2000s era stuff. The future is bright, thanks to virtualized storage arrays turning commodity storage into massive virtual SANs with tiered storage on consumer SSDs being used like race tires, consumables replaced periodically to maintain top performance, and so on. Even so, the biggest benchmarks I've seen for enterprise systems with multiple 10GbE adapters running raw disk IO has been on the order of 1 million IOPS. I'm sure exotic systems will put out higher numbers, after all there are machines that support over 100 physical CPUs, but they aren't attainable and certainly aren't a broad market.
All of those words were said to essentially say that databases have almost always been constrained by disk IO. The SDN controller in the paper? Limited if any disk IO. A SQL database? It probably could be written in naive, pre-java.nio Java and still IO limitations would dwarf the overhead of the language. (There are exceptions, I'm ignoring certain overheads, etc.)
Maybe a NoSQL solution in Haskell would scream with this new IO manager, but I suspect it's going to be correctness rather than performance that drives anyone to implement their database in Haskell right now.
> Mio will be released as part of GHC 7.8.1