• 0 Posts
  • 75 Comments
Joined 2 years ago
cake
Cake day: July 1st, 2023

help-circle

  • Clojure has it’s own set of idioms; it comes with some small surprises for old lisp hands. There are some things it’s really brought into the mainstream: performant persistent data structures in particular.

    As well as excellent tooling and pedagogy, the principle attraction of Racket is the macro system. There’s a great book about this (this is true of just about all aspects of Racket). Racket’s focus is on building a tower of languages via macro extension. Metaprogramming is thematically FP-adjacent but neither sufficient or necessary; but if you’re looking for a fun learning experience it’s really worth a look.

    In terms of employment opportunities - I know of several Clojure shops (on the JVM it has the bonus of being able to take advantage of the hole ecosystem), but I’m not aware of anywhere that’s using Racket outside of the academic sphere.







  • It won’t (using your example explicitly) but in general what you’ve discovered is that:

    1. Variables hold values
    2. Some of those values are references to shared mutable objects.

    Lists fall into the second category. There are ways to copy lists if you want distinct behaviour.

    list2 = list1[:]
    

    will perform a “shallow copy”. If you have a list of lists, however, the nested lists are still shared references. There is copy.deepcopy available to make a complete clone of something (including all its nested members).


  • Yeah, a more modern take on mutexes (as boxes for values) and support for structured concurrency would be fabulous. Those are somewhat orthogonal to the goal of being able to write straight-line code without function colouring. Long ago, eventlet provided something like this [although it had smoe subtle and deep bugs that took a long time to track down].

    Potentially, a major stumbling-block would be providing machinery so that interleaved FFI & python calls can cooperate (if that’s determined as being in-scope, which it ultimately should be).








  • You typically learn to feel the accelerator and brake with one foot but just engage the clutch (ie, all the finesse is letting the clutch out). But you know this. All your muscle memory works like that. When you switch to automatic, just use the one foot and it works much better.

    You have probably already worked that out but it’s handy advice if you’re a passenger in an automatic with a first-time driver who is used to manual.