6 ms·
Stop Writing Dead Programs
- Aloha 4y agoWasn't this just on here like two days ago? Yes it was, mods merged the text link with the video link. https://news.ycombinator.com/item?id=33251799 https://news.ycombinator.com/item?id=33251799
- donquichotte 4y agoI watched the video when this was last submitted and he makes some interesting points with many of which I disagree. Images as illustrations in the code: Yeah, sure, it would be nice to have the Vitruvian Man in the code, but it's also nice to be able to re-open your text file in 5 years, when development on the IDE has stopped and it no longer runs on current operating systems. Also, animations would be hugely distracting. Code cells: With jupyter and spyder I have been bitten by lingering obsolete state from re-running cells or code blocks various time. I find the program much easier to debug if it runs on a clean slate and builds all the state from scratch. If building state takes long, I try to cache, save it to disk, and go from there. Nonetheless, an interesting perspective.
- nequo 4y ago> Yeah, sure, it would be nice to have the Vitruvian Man in the code, but it's also nice to be able to re-open your text file in 5 years I imagine this as an Emacs package that recognizes tree-like code patterns (like what he showed in the video) and replaces those patterns inline when you toggle it. Your code is still the same plaintext. But your editor can display chunks of it as graphs. Emacs does this already in latex-mode and org-mode for math formulas.[1] It shouldn't be a stretch to do this for other types of code, too. [1] See this example in markdown-mode: https://external-preview.redd.it/ETo2U5C7vh5o4482sMcnYbkZ6LxfIb_2ePbPGBObW0k.png?format=pjpg&auto=webp&s=b05871716101838bb6310bf7fe6c92c79a91ecc9 https://external-preview.redd.it/ETo2U5C7vh5o4482sMcnYbkZ6Lx...
- joeman1000 4y agoThis is already quite simple. You can have a .org buffer with SRC blocks & have their output displayed underneath (exactly like a jupyter/Pluto notebook). I’m thinking you can define a function and underneath it you can say something like “@structure myfunc” to get an image of the structure as the src-block output.
- nequo 4y agoThat would be phenomenal. And even better if it works outside of org-mode!
- tinus_hn 4y agoIf only we had some standardized and ubiquitous kind of format, a markup language that allows hyperlinks. If could have embedded pictures and interactivity!
- blep_ 4y ago> With jupyter and spyder I have been bitten by lingering obsolete state from re-running cells or code blocks various time. I find the program much easier to debug if it runs on a clean slate and builds all the state from scratch. Hm, reading this just made my brain connect the reasons I don't like Jupyter with the reason I am baffled by people who like Smalltalk. An image that you can't fully restart just... doesn't seem like a pleasant development environment.
- kragen 4y agoI'm glad to see this talk transcript is back on the front page where it belongs! The previous post, which unfortunately got castrated into a video link, is https://news.ycombinator.com/item?id=33251799 https://news.ycombinator.com/item?id=33251799; my comments are at https://news.ycombinator.com/item?id=33256626 https://news.ycombinator.com/item?id=33256626.
- notRobot 4y agoFixed link 1: https://news.ycombinator.com/item?id=33251799 https://news.ycombinator.com/item?id=33251799
- kragen 4y agoOh, oops, thanks.
- rob74 4y agoWell, if the transcript contains stuff like: > I'm going to ask you for some feedback at some different places, so first off – by applause – how many of you know what this is? Okay, okay, that's actually more than I expected. Now, how many of you actually used one of these? Okay, so what I can say is that I am part of the last generation of people who were forced to use punch cards at school. ...that makes me think I'm probably better off watching the video.
- isaacremuant 4y agoThe transcript with timestamps does not make for easy reading either. Ideally, there'd be a simple text only version if the intention is for people to read as opposed to be an index for the video. Would be interesting to see reading engagement with that change.
- pmontra 4y agoBut the video is 43 minutes that I don't have today and probably never. I skimmed through the transcript and I didn't find the point (which dead programs?) So I better find the time to watch the video or read the transcript or do something else, like I do for most content available as video. I prefer short to-the-point blog posts.
- vishnugupta 4y agoWhile you are here Stop Drawing Dead Fish by Bret Victor https://www.youtube.com/watch?v=ZfytHvgHybA https://www.youtube.com/watch?v=ZfytHvgHybA
- compressedgas 4y agoAlso https://news.ycombinator.com/item?id=14460013 https://news.ycombinator.com/item?id=14460013 https://www.emilydamstra.com/please-enough-dead-butterflies/ https://www.emilydamstra.com/please-enough-dead-butterflies/
- peterkelly 4y agoSince the talk was already posted yesterday, here's another great related video that is well worth watching: Dan Ingalls demonstrating Smalltalk 76 on a restored Xerox Alto. https://www.youtube.com/watch?v=uknEhXyZgsg https://www.youtube.com/watch?v=uknEhXyZgsg This is where it all started and it's truly amazing what they achieved on such limited hardware.
- mlajtos 4y agoI loved how he nuked the image by entering wrong code. Having a live system is awesome, but in instances like this, we should start thinking about Kay’s notion of “computers all the way down”, i.e. virtualization. So no matter how much corruption you do to a system, it should be still able to fully restore its functions without a reboot.
- peterkelly 4y agoThat was my favorite part :)
- infinite8s 4y agoIt's interesting that from the perspective of today the Alto looks limited, but at the time it was built it was basically a look at what powerful hardware might be like in 10-15 years (so mid 80s - which was pretty close in terms of a Lisa). So the equivalent would be trying to imagine what an individual's computing power would be like in 2035, and building a system to that. For example, about half the memory of the Alto was just used for the bitmap display, which makes the system even more remarkable for what it could achieve with an economy of code. From what I've read, they had a plan to design a new system in the mid-70s (that would again look 15 yrs into the future) but at that point they got enough pushback from Xerox that they were not able to get the funding for that.
- spion 4y agoStop trying to make Smalltalk happen, its not going to work! I kid, but I also wish there was some understanding that once state goes bad (as it very often does during program development) you really do want to restart that program from scratch. Or at least a part of it, I guess - an Erlang process will do. (Unless you have very good time-traveling tools for the entire program state. Which can be prohibitively expensive).
- aidenn0 4y agoI don't know about Smalltalk, but a typical Common Lisp implementation will certainly allow you to restart the program from scratch. Mutating state in a live program shouldn't be done carelessly (any more than a schema migration on a live database), but removing it completely from the toolbox is overly restrictive, especially since that also involves removing it from the toolbox while testing and developing.
- Jtsummers 4y agoDespite many people's beliefs, yes. Smalltalk can be restarted from scratch. First, the images are paired with a serialization of the source code. If you used nothing else you could restore the source in an image via that, it can also be used to produce diffs for distribution. That's not the best way, but it is a viable way. The better way is tools like Iceberg and its various predecessors (Iceberg is nice because it works with git which has become the industry standard at this point for version control). There, you select down to the individual method what you want to commit and you can push it to other git repos on services like Github.
- chrismorgan 4y ago> I wish they had frozen a primitive version of JS and added a marker at the beginning of scripts to switch out which language is used, much in the way #lang does in Racket. JavaScript has had basically this several times (though not after the extreme flexibility of Racket’s #lang). • In the context of HTML, there was <script language="…">, with a variety of unstandardised values for the language attribute, e.g. javascript1.0, javascript1.4. I think there were also unofficial MIME types that worked too (something like <script type="text/javascript;…">), but it’s hard finding documentation for this ancient history and I haven’t tried for more than half a minute. In the end, it died for lack of utility and because in practice new versions didn’t break anything worth mentioning so it was all just the one thing under the hood. • Strict mode <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...>, via the "use strict" statement at the start of files and functions. Also "use asm" as another pragma that opted out of most of the language for performance reasons. • And ECMAScript Modules are to some extent a new file format, and a module’s contents are automatically in strict mode. Suffice it to say: they can remove stuff if there is any will too. But there is not.
- murermader 4y agoThis is awful to read on mobile. I tried but the formatting makes it really difficult.
- tmtvl 4y agoDon't worry, it's awful to read on desktop too. Thank RMS for Emacs, making reformatting the entire thing a cinch.
- the-smug-one 4y agoWhy can't our programs be dead but our tools alive? Having a static and full world view allows your tools to do a lot more. An alive and very dynamic program allows you to run fine-grained strands of control flow, a dead and static one allows you to run coarse but large amounts of strands of control flow. Let me ask more complex queries, don't give me this hand-rolled LSP crap. Here are some things that I've done/found out manually that I want my IDE to do for me: 1. General inter-procedural analysis queries: - Does anyone pass in null? - Is X set in each path that can be taken? - Take a theory, for example numerical ranges, what can you tell me about this function? - Is this probably a hot function? - Are any of these sum type ctrs unused? 2. Show me counter-examples of things I believe about the code, don't force me to find them myself. 3. Predictable, but non-standard (not pre-rolled by IDE), refactoring. I had to grep and do an Emacs macro that went through the list of matches, one execution at a time. Why can't the IDE record my actions, show me the AST transformation that I did, and let me apply them for some qualifying criteria across the whole codebase? 4. Let me apply semantically equivalent code refactorings within a function by picking cost-based heuristics. For example, "flatten indentation levels". 5. Do coarse-grained semantic analysis for me, "are these the same on a type-level? OK, now apply this theory, still the same? Aah, I'm about to go for lunch, just run the whole analysis". 6. Let me save any thing I've done, so that I can use it in the future Something like that, that'd be great. I have 128GB of RAM and like 64 CPU cores and I'm using my brain on this 1M+LoC codebase while they sit idle. Lazy bums, I tell ya!
- CraigJPerry 4y ago>> Why can't our programs be dead but our tools alive? Is that what you really want or is that a tradeoff point short of ideal that you’ve selected as acceptable? To put it more concretely, if you could have alive programs and alive tools, would that not be the pinnacle? Well categorically yes because an alive program has every capability a dead one has, including the ability to mimic “dead” one. The problem as we all know is it appears to be impossible to write maximally alive tooling in the presence of alive programs because there’s no way to analyse them sufficiently with the compute available to us. And so we select a trade off. Aiming for the tradeoff point as the ultimate solution does us all a disservice though. We should call out that it’s a trade off (and a reasonable one at that) but what we really want is alive/alive!
- athrowaway3z 4y agoWe can't do reflection and visualization
- agentultra 4y agoMan gesticulates wildly. Asks why computers can’t read our minds and do what we intend. How are we stuck with terminal emulators, lol. Okay terminal emulators need to go. And there are replacements these days. Some are better than others. But dang it they just don’t seem to catch on. I don’t value debug-ability as highly as he does. I find that once you have a program with shared mutable state and concurrent or parallel threads, debugging loses its utility. I much prefer being able to reason about my programs in a principled way than trying to figure out how my program failed by piecing things together from debugger output. I’ve also had a pretty long career and have done both and arrived at almost the opposite conclusion: both are good but I prefer correct by construction, static type systems, and proofs. I guess that makes us necromancers? Raising and keeping dead languages moving and doing out bidding? It would be neat to have an image-based runtime like Commmon Lisp or Pharo (SmallTalk) while the language is statically typed in a rich system like Lean that can generate optimal native machine code and GPU shaders, etc. A fast, interactive theorem prover is also a must. If I’m gonna have my cake and eat it too might as well go all in.
- williamcotton 4y ago> It would be neat to have an image-based runtime like Commmon Lisp or Pharo (SmallTalk) while the language is statically typed in a rich system like Lean that can generate optimal native machine code and GPU shaders, etc. A fast, interactive theorem prover is also a must. If I’m gonna have my cake and eat it too might as well go all in. What is stopping you from working on this?
- agentultra 4y agoTime and money. Get me funding enough for myself and another dev and some customers and let’s go.
- agentultra 4y agoMy dream project, if I ever win the startup lotto and come into some "mess around and find out," money, would do one better: let's not even require a graphical display or keyboard input. My personal goal here is to be able to write my programs by synthesizing them from proofs that I write by hand. Whether that is on a special device like an eInk reader or on a whiteboard; my work carries around with me where I choose to take it. I would love a world where my physical attention isn't focused on a glowing box with graphics designed by some company in Palo Alto or Cupertino who is designing for mass audiences with profits motivating every decision (and change). Why even hard-wire ourselves to the physical legacy of terminals? There are plenty of humans who aren't even afforded access to modern computers in manners that are convenient to them and respect their abilities and capacities! The entire design of modern computing is centred around able-bodied, able-minded "mass-market" people -- whatever that is. It's frustrating that any other mode of computing is an after-thought, an inconvenience, and attached to these machines in order to meet people where they are. Often times the answer is simply, "Nope, sorry." Particularly inspired by: DynamicLand, https://screenl.es https://screenl.es etc
- phtrivier 4y agoI've always been troubled with the "observability" of Erlang/otp, because everytime I had to fire up wobseever, it was because I had put my system in such an unresponsive state (infinite message loop, some single actor congestionned because of third party code, or a supervisor tree crash looping because of a typo in the name of a variable that no compiler was there to catch) that wobserver _itself_ was useless. And for the "sequential" part of the program, I would have loved a debugger on par with what's in my browser's dev tool, but it goes against the Erlang philosophy, or something. Still, I can't wait to try smalltalk when it becomes relevant again thirty years in the past ; and if it's strangeloop video season _again_, and since I still can't write native clojure, I guess I'll try to install sbcl _again_ and set up slime _again_ and see if I get it, this time ?
- tmtvl 4y agoYou may want to try Sly rather than Slime, you may prefer its UX. Speaking of SBCL and Clojure, I have used Stumpwm and the Nyxt browser for a while and they both seem to run very well; I wonder if CLJ has any nice desktop applications that show off how it runs.
- phtrivier 4y agoYou're right, apparently the default slime-like mode is sly, I suppose that's what all the uncool kids use nowadays ;) To be fair, clojure was designed with long lived servers in mind, so the "JVM takes ages to start and load the class path" tradeoff makes sense. A downside is that any GUI built in clojure will either has to jump through some AOT compilation hoops (graalvm, etc), or accept being slow as hell to boot. This alone has been enough to dissuade me to write anything with a UI in clojure. Maybe the space has changed since last time I tried, though.
- otikik 4y agoJust an fyi for the author in case he’s around: the CSS for mobile has fumbled the lines, each last word on the script overflows to the next line.
- jrvarela56 4y agoWorth the repost, I really wish stuff like Clojure and Pharo became mainstream/defaults. For now I have to settle with side projects every now and then. If devs became aware of how fun and fast their workflow COULD be we'd get these features in more mainstream frameworks.
- thomasjudge 4y agoThat's about the most annoying transcript format ever
- waffletower 4y ago
- dang 4y agoRecent and related: Stop Writing Dead Programs [video] - https://news.ycombinator.com/item?id=33251799 https://news.ycombinator.com/item?id=33251799 - Oct 2022 (215 comments)
- lamontcg 4y agoAfter spending 10 years programming at a low level in a dynamic language like Ruby I'm running as fast as I can into Rust. I agree with him on nearly everything else, as well as how people should understand at least the big picture stuff about Erlang better (and Go would have been a much better language by embracing crash-first design and not boilerplate error checking literally everywhere). I don't know how you get fast feedback from a highly type checked language, but fully dynamic YOLO languages certainly aren't the answer I'm looking for.