4 ms·
well I'm sure as hell not using this on any Haskell* code (imagine we apply the malloc sound effect to generic allocation) * Any GC'd language really, JS, Java
by olliej 6y ago
well I'm sure as hell not using this on any Haskell* code (imagine we apply the malloc sound effect to generic allocation)
* Any GC'd language really, JS, Java w/generics etc
- jstimpfle 6y agoI think inefficiencies in these languages come more from garbage collection languages. Allocation is faster since it is optimized with the knowledge that allocations will be GC'ed, and static analysis can help a lot for the short term stuff. Memory can be allocated with linear allocators inside arenas for short term memory, and be moved to longer term arenas when it lives longer. Stuff like that.
- chrisseaton 6y ago> well I'm sure as hell not using this on any Haskell* code I think this is literally already a feature in Haskell, except it beeps on GC rather than allocation. https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/runtime_control.html#rts-options-for-hackers-debuggers-and-over-interested-souls https://downloads.haskell.org/~ghc/latest/docs/html/users_gu...
- 1f60c 6y agoThat's cool, but could you tell me how to use it? When I try ghc -B hello.hs I get an error Missing file: ./settings . If I then touch settings platformConstants the error changes to Can't parse "./settings" . What am I supposed to put in this settings file? I'm but a Haskell noob, and this is the first time I've heard of it. EDIT: I found it! The correct command is ghc hello.hs +RTS -B . I can't seem to get it to beep on macOS, though.
- chrisseaton 6y agoIt just prints \a - it's up to your Terminal what it does with that. Does print "\a" work in your terminal?
- 1f60c 6y agoYes, it does, but my terminal's "silent bell" feature had been enabled. I disabled it, and it worked, though only while compiling, and not during runtime, strangely enough.