• 0 Posts
  • 9 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle

  • I recently spent some time optimizing a small Julia program I wrote that generates a lookup table of brainfuck constants. Because it only needs to run once, I originally didn’t care about performance when I originally wrote it (and the optimization was mostly for fun).

    I achieved an ~100x improvement by adding types, using static arrays and memoization. In the end, the performance was mostly limited by primitive math operations, I tried using multiple threads, but any synchronization destroyed the performance.

    However, the most impressive thing was the ability of Julia to scale from dynamically typed scripting language to almost a compiled language with minimal changes to the code.





  • I don’t really have a single favorite a language, if I am able to choose freely it depends on the task.

    • C++ for natively compiled programs and C interoperability, I like the types from the STL and templates.
    • Clojure is IMO great for data-oriented programs, I really like the immutability and it being a lisp. The java interop and the ability to compile to JavaScript with clojurescript can also be useful.
    • Julia for smaller (mostly numerical) programs that should be fast at runtime. The type system is great in being optional, but strong and significantly improving performance when types annotations are used.
    • Fennel (or Lua) is definitely my favorite Language for embedding into larger programs and scripting. Fennel has the advantage of being a lisp and cleanly compiling to lua.
    • brainf*ck is great as a simple language to have fun and enjoy programming



  • eeleech@lemm.eetoLinux@lemmy.mlHDD or SSD?
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    Of course anecdotes are of very limited usefulness, but I had exactly the opposite experience. The HDDs that failed on me, failed slowly with SMART errors that gave enough time to make a backup, and never failed completely. On the other hand I had a cheap SSD die completely and without any warning after only limited use, and experienced bit rot even on reputable vendors.

    tl;dr choose what you want but make backups