4 ms·
As a present day Lazarus/Free Pascal programmer... I found this dive into history interesting. I had an almost allergic reaction to the idea of not type checkin
by mikewarot 6y ago
As a present day Lazarus/Free Pascal programmer... I found this dive into history interesting. I had an almost allergic reaction to the idea of not type checking everything at compile time, but I do see how in some cases it can help if that is postponed.
What was REALLY interesting to me was the idea of objects as processes, and passing messages instead of function calls. The machine I'm using to type this has an 8 cores, and I can see that thousands are on the way eventually. Hanging on to programming models that only execute serially will become very time prohibitive in the near term future.
The idea of immutable variables always struck me as oxymoronic... but if an object is always resolved by id or name each time it is used, it resolves some rather nasty deadlocks, while allowing failure to be recovered from.
It seems obvious to me that I'm going to have to give up the ability to know exactly how variables are stored, in order to gain this flexibility. It seems like it will be worth the trade off, as compute cost declines, and communication costs remain relatively constant.
There is much in this to ponder, thanks for sharing.
- dunefox 6y ago> The idea of immutable variables always struck me as oxymoronic It is, they're called constants.
- willtim 6y agoThat's a bad choice of name from one or more old languages that misused established mathematical terminology (e.g. C misuses void, constant and variable). An immutable variable (or in maths, just "variable') has a value that is unknown at build time but is constant at runtime. A constant has a known value at build time. What nearly every language calls a variable today, is probably better described as a "reference" or "assignable", but sadly that ship has sailed and we'll forever be inconsistent with the math terminology for that one. Immutable variable is therefore a useful synonym for "proper variable".
- evacchi 6y agoI like "(name) binding"
- agumonkey 6y agoIt's variable in the mathematical sense, not the memory machine sense. f(x) <= x is a variable, but once you picked a value for x you have no means to 'modify' it. Mathematicians seem to frown upon that for consistency reasons and instead will define a new variable name for a derived information from x current value. ps: I'm not sure how true it is, but there was a picture of Ada Lovelace writings saying that Babbage computing machine caused troubles because you couldn't keep track of the value of a gear/variable which made design on paper very error prone
- mikewarot 6y agoBad choice or no, the language is appropriate... Constants should remain constant at runtime. Variables should be allowed to vary. I don't see why people think immutable strings is a good idea, for example. How do you ever build a text editor, if the strings can't be edited?
- willtim 6y agoThe language and notation is inconsistent with hundreds of years of use in maths and confusing for kids learning both maths and programming (at least it confused me). Regarding your skeptism of immutable data structures, it's best to think of immutable data and data structures as copy-on-write instead of update-in-place. This is a technique that is currently very underused, for example most programming languages do not come with "persistent" copy-on-write collections. Here is an example text editor built using immutable data structures in C++: https://github.com/arximboldi/ewig https://github.com/arximboldi/ewig Advantages are excellent support for concurrency (background save works while you edit) and trivial support for undo/redo.
- mikewarot 6y agoI tried diving into the source code, and immediately ran into something new :: everywhere and starting googling.... Namespaces?!? - Looks like a solution in search of a problem. The whole point of object oriented programming was to prevent reaching inside of objects from the outside, thus making then implementation independent from use... Namespaces seem to break that. Like leaving the cover off a machine so that you can push on one of the relay contacts by hand. C, C#, C++ feel to me like Greek all sorts of keywords that make no sense, and random !@#$%^&*():"<>?[] everywhere Somewhere at the top of all that code, there has to at least be one actual pointer variable where you keep track of the last revision, isn't there?
- inglor_cz 6y agoThere is a difference between "real constants", like the value of pi, and "runtime constants or almost-constants", such as "liftoff time" in software that runs onboard a rocket going to space. While preparing for launch, the latter value may be changed, but once the vehicle is on its way, it becomes a constant until the end of mission. It would be nice to protect such variable from modification, "lock its value" somehow.
- sgt101 6y agoWell, OO folks would say : Enapsulate it in a class which contains a check for lift off and a value change method. I would say "yes it's nice, but it's also complex and you are just as likely to inject a bug by doing this as you are to prevent a failure". (although for this example I think it isn't a bad idea really)
- mikewarot 6y agoI have no idea what the heck is going on with objects in C++, it makes no sense to me. The model in Delphi/Lazarus/Free Pascal has always seemed quite natural to me since I first encountered it.
- pjmlp 6y agoI think you will like this stuff, http://pascal.hansotten.com/ucsd-p-system/apple-pascal/ http://pascal.hansotten.com/ucsd-p-system/apple-pascal/ http://bitsavers.informatik.uni-stuttgart.de/pdf/apple/lisa/toolkit_3.0/Package_2_Examples/02_An_Introduction_To_Clascal_Jul84.pdf http://bitsavers.informatik.uni-stuttgart.de/pdf/apple/lisa/...
- zelphirkalt 6y agoObjects as processes and function calls as messages - That idea was already described by Alan Kay for some version of Smalltalk, where they did that. It also is quite similar to what an actor system does.
- CyberDildonics 6y agoQNX was also based on this concept at a macro/OS level instead of the expression level like smalltalk.
- di4na 6y agoYou may be interested in exploring erlang or one of the language based on it. I am partial to elixir. It is... a lot like what you talk about here.