← Home ← Back to /g/

Thread 106378106

27 posts 10 images /g/
Anonymous No.106378106 >>106378138 >>106378254 >>106379457 >>106379466 >>106380333 >>106380429 >>106380443 >>106380795 >>106380868 >>106381422 >>106381676 >>106381722
Is this the true power of Functional Programming?
Anonymous No.106378138 >>106379391 >>106381392
>>106378106 (OP)
Clojure is a LISP not a pure functional language.
Anonymous No.106378254 >>106381444
>>106378106 (OP)
Woooww!!! A game running in the high 20s! INCREDIBLE
Anonymous No.106379391
>>106378138
>Year 15 of two more weeks until Haskell is faster than C
Anonymous No.106379457 >>106381209
>>106378106 (OP)
> probably don't want Java or C#
Java is a lot faster than Clojure though. 99% of the JIT optimizations in the JVM don't apply to Clojure programs because everything is stored as the base Object which the JIT can't make any assumptions about. Clojure also creates an absurd amount of short lived objects which triggers an enormous amount of garbage collection phases.

You can get extremely far with Java and C# and Clojure isn't in the same ballpark.
Anonymous No.106379466
>>106378106 (OP)
Is this from Uncle Bob? I remember a retarded tweet from him a long time ago where he was bragging about his little spacewar demo with like 10 polygons running at 20FPS.
Anonymous No.106380333
>>106378106 (OP)
do NOT make fun of clojure!!!!!!! its trying its best >:(
Anonymous No.106380429
>>106378106 (OP)
>I could keep the frame rates up in the high 20s
is this the standard nowadays
Anonymous No.106380443 >>106380509
>>106378106 (OP)
Solid punchline. Thought it was real cope until that point.
Anonymous No.106380509 >>106380983
>>106380443
It is not a joke.
https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html
Anonymous No.106380795 >>106380835
>>106378106 (OP)
was it really realtime or does he not understand what that means? also, if he turned on dlss and framegen he could get that shit over 100fps.
Anonymous No.106380835
>>106380795
he's not a good developer. his skill is making presentations to convince management that he is, then comes to your company at an absurd hourly rate to tell you how to write software correctly. the correct move is probably to key his car or something
Anonymous No.106380868 >>106381140
>>106378106 (OP)
what an awful font. why are the numbers so ugly?
Anonymous No.106380960
https://dev.to/gefjon/eliminating-clos-for-a-45x-speedup-3omf
>reddit user 3y ago Edited 3y ago
>CLOS has a bunch of very wonderful to work with features. I wouldn't do such an "optimization" for some time compared to cleaner code wins. But then I have distrusted such things since people wanted to factor out object messaging in other languages or even reduce the number of functions in the name of "efficiency". I wouldn't got back to structs and functions a la ancient structured programming and functional decomposition a la C era without working pretty hard to not throw out so many babies with that bath water. Why not spend the energy on better MOP implementation bits and better compilation?
>2 upvotes
Anonymous No.106380983 >>106381143 >>106381413
>>106380509
if the game is 3d that is quite impressive
Anonymous No.106381140
>>106380868
That’s the “Georgia” font or some clone.
Anonymous No.106381143
>>106380983
It's 2D and trivial. Even a JavaScript brainlet could make it run at 100,000 FPS.
Anonymous No.106381209
>>106379457
Interesting an thoughtful insights on clojure jvm runtime performance.

I assume this will spawn thousands of new master’s thesis on improving hotspot and “new” gc algorithms for clojure like we had before.
Anonymous No.106381326 >>106381471
clojures persistent data structures are slow. no "immutable" data structure will be fast, but will provide functional semantics. things like vectors in clojure are actually just high branching trees, so you can retain each version of the vector without too much redundant data.
Anonymous No.106381392
>>106378138
clojure is not really even a lisp, and is more so a lisp tribute language. i really like the language and mostly that is because it is a "lisp-1" and provides syntax for commonly used data structures. it is very elegant.
Anonymous No.106381413
>>106380983
It's not, and no it wouldn't be
Anonymous No.106381422
>>106378106 (OP)
lol me when I read high 20s
Anonymous No.106381444
>>106378254
but the human eye can only see 20fps
Anonymous No.106381471
>>106381326
>things like vectors in clojure are actually just high branching trees
No wonder it's absurdly slow.
Anonymous No.106381676
>>106378106 (OP)
https://store.steampowered.com/app/2495130/Pixelpusher/
https://gitlab.com/-/snippets/4817016
>From the summary statistics at the bottom, we have average garbage collection pause times of < 1 ms and maximum pause times of about 5 ms.
For reference, since we update and display the game state 120 times a second, we have a time budget of 8.3 ms per frame.
A pause of 5 ms would be over 50% of our time budget, which would be unacceptable.
>However, looking above at the statistics for individual garbage collections,
we see that all of the longest pauses occur at the very beginning when the game is starting up, before the start of gameplay.
The pauses during gameplay are shorter: out of 1382 garbage collections, 1 took 2 ms (of elapsed wall clock time), 6 took 1 ms, and the rest took 0 ms.
Uncle Bob BTFO.
Anonymous No.106381722
>>106378106 (OP)
FP isn't used for any serious work which is why math fags love it.
Anonymous No.106382368
Babashka is nice tho