3 ms·
Interesting, thanks for the detailed breakdown. How's support for directly mapping chunks of memory to packed structures? We used to do a lot of in-place loadi
by vvanders 8y ago
Interesting, thanks for the detailed breakdown.
How's support for directly mapping chunks of memory to packed structures? We used to do a lot of in-place loading in games(yay for spinning, physical disks) so it being able to do blind casts was almost as important as value types themselves.
- tathougies 8y agoHaskell allows unsafe pointer arithmetic and manipulation (of course, the functions are all named 'unsafe'!). But, you can write safe interfaces on top of it. I have an example of an external sort using the standard fibonacci merge algorithm, which uses raw pointers and memory mapped IO under the hood, but which exposes a safe API. I've done some basic benchmarking, and it's about as fast as Postgres's sort on my machine, for simple binary doubles and ints. Here it is: https://github.com/tathougies/extsort/blob/master/Data/External/Sort.hs https://github.com/tathougies/extsort/blob/master/Data/Exter... . I think it's a good example of 'low-level' Haskell.
- nickpsecurity 8y agoIf looking into low-level Haskell, you might find House interesting given they did an OS in it: http://programatica.cs.pdx.edu/House/ http://programatica.cs.pdx.edu/House/ Although old, there's probably some useful concepts in there for balancing low-level needs against what Haskell gives you. I figure recent work in Haskell, Rust, and Idris might even be combined with their techniques for better results. Under HASP project, were designing a version of Haskell for systems programming called Habit, but one or more got poached into better project. Here's that language: http://hasp.cs.pdx.edu/habit-report-Nov2010.pdf http://hasp.cs.pdx.edu/habit-report-Nov2010.pdf