Live data from Hacker News

Malleable computing, Emacs, and you

yummymelon.com

51–57 of 57 posts

Re: Malleable computing, Emacs, and you

#51

Earlier quoted context omitted.

Could you elaborate on BIBO? The wiki article is a bit above my pay grade

Sure. My reference to BIBO borrows the idea from control theory that if you put bounds on your input, your output will likewise be bounded given your system is BIBO-stable. Applying this to software, if you constrain the range of input to values that will be correctly processed, then you could exploit this to write less code (example: relax building type-checking and error handling code if you know the input is going…

This makes total sense, thank you. I come from a Python background and appreciate a similar philosophy in Ruby, which is that sometimes it's just nicer and easier to not do typing. It's okay to prioritize aesthetics and ease in code.

I've gone much deeper into type checking since then, but I still like simple, dynamic scripting.

I've heard "functional core, imperative edges" and I feel like that kind of applies to static vs dynamic. I think there's a lot of cases where exposing a scripting language is a perfectly sane and good design pattern.

I'm not sure Emacs fits that category, hah, but it's just so dang useful.

I had not heard of control theory, I appreciate this

Re: Malleable computing, Emacs, and you

#52
I'm preparing a talk on malleable software for a product management audience, and I've noticed just how hard of a concept it is to grasp outside of engineering.

Us engineers are used to the tools we use being flexible. It's only as we need tooling to be palatable to other audiences they become more constrained. For non technical people, malleable may as well mean complicated.

We're going to see this change, but breaking this concept out of engineering is an uphill battle.

Re: Malleable computing, Emacs, and you

#53

Earlier quoted context omitted.

I don't know first hand of anyone who ever used it for anything. Maybe I knew the wrong Mac users (mostly teachers).

Re CharlesW: OSA was an OS-level malleable-computing layer, on paper. Apple Events exposed scriptable objects; OSA let multiple scripting dialects share the same runtime. The gap was who actually shipped working product. Dave Winer's Frontier (UserTalk) is the piece these threads usually skip. Frontier 1.0 shipped in January 1992 -- the same month Apple finally held its one-day scripting developer conference, after y…

Always a pleasure to sit down for Mr Hopkins' story time. Many gems of ideas and memories.

For others like me who hadn't heard the word "fahrvergnügen", it translates to "pleasure of driving". From German fahren ("to drive") + Vergnügen ("pleasure/enjoyment"). The term was popular in advertisements for Volkswagen vehicles, which seem to have certain affinity to Apple products (past and now, good and bad sides).

Dave Winer's personal site is still up and running on UserLand Frontier! http://davewiner.userland.com/default

> ..how I got involved in outlining while I was learning about programming on my way to doing an BBS which turned out to be an outliner which turned out to be part of a scripting system.

> the idea came from LISP programming systems that had hierarchic program editors. I wanted to see if the same thing could be done for Pascal. The result was a development system that ran on PDP-11s under Unix that viewed and edited source code as a tree. This embryonic outliner could dive and surface, displaying one level of the hierarchy at a time. Programmers could edit the structure of their programs directly.

Fascinating stuff, this is like a structural/projectional editor for oulines and documents, extensible with scripting. Well, I have a dozen tabs open now, I'll enjoy reading through them. The Frontier manual with little screenshots of classic Macintosh interface is sweet, nostalgic and inspires me to imagine what a new take on the idea might look like, with modern web tech and benefit of hindsight.

Re: Malleable computing, Emacs, and you

#54

Earlier quoted context omitted.

The Smalltalk approach doesn't really integrate well with anything else. If you treat data and code the same, it's hard to separate code from data. If you're writing a program for a single machine on which it should be used, that's fine, but if you want to write your code once and run it across many machines, that's a problem. ERP systems are a bit like this; system owners (businesses) are often able to change any pa…

> The Smalltalk approach doesn't really integrate well with anything else. That's not true. GToolkit (built on Pharo Smalltalk) integrates tightly with Git for VCS and Rust via FFI for external libraries. It integrates with external Python and JavaScript through IPC. The same IPC mechanism is used to work around the GIL (the same way Python used to do with the multiprocessing library). Squeak descendants are also not…

I follow GToolkit from time to time but each and every time I'm a little disappointed there's no code editor with LSP integration like Emacs has major modes for programming. I (think I) understand where they're coming from that GToolkit should be used to build tools to inspect and analyze your codebase and problem domain but I feel that it's such a heavy investment to make (kinda like Emacs) and I don't receive that last bit of payoff of being able to create in it too.

Please correct me if I'm wrong and things changed in the meantime. I really want GToolkit to be a complete IDE.

Until then I'll wistfully watch from the sidelines, dipping my toe in from time to time.

Re: Malleable computing, Emacs, and you

#55

Earlier quoted context omitted.

> The Smalltalk approach doesn't really integrate well with anything else. That's not true. GToolkit (built on Pharo Smalltalk) integrates tightly with Git for VCS and Rust via FFI for external libraries. It integrates with external Python and JavaScript through IPC. The same IPC mechanism is used to work around the GIL (the same way Python used to do with the multiprocessing library). Squeak descendants are also not…

I follow GToolkit from time to time but each and every time I'm a little disappointed there's no code editor with LSP integration like Emacs has major modes for programming. I (think I) understand where they're coming from that GToolkit should be used to build tools to inspect and analyze your codebase and problem domain but I feel that it's such a heavy investment to make (kinda like Emacs) and I don't receive that…

EDIT: Argh, I misunderstood your point: you'd like to use GT as an IDE for non-Smalltalk code, right? I took "LSP integration" to mean "GT providing LSP server implementation", while you meant "GT implementing an LSP client", I think.

That's not something I ever thought I needed, though there is some support for syntax highlighting for JavaScript and Python, I think. I don't think GT is supposed to be a general-purpose, polyglot IDE: it's a bit more specialized than that, IIUC.

I'm leaving the off-topic rant below; it's a bit too long to just delete :(

> Please correct me if I'm wrong and things changed in the meantime.

Sadly, you're not wrong, and as an Emacs user (since 2012) myself, I share your reservations. The text editing widgets in GToolkit are usable, but nowhere near what you get in Emacs. Multiple cursors, iedit, re-builder/visual-regex, editable occur, AST-based editing (paredit/combobulate) are just some of the features I use regularly in Emacs which are (and will be, for a long time) missing in GT. On the flip side, rich formatting, inline images, and interactive widgets are way easier to implement in GT than in Emacs, and Lepiter is a good alternative to Org.

The conventional answer to that is that you shouldn't need those more advanced editing features when working with Smalltalk: the method bodies should be short, you should be using refactoring commands instead of hand-editing code in many places at once, and you should just auto-format after each edit. Even if it's not technically incorrect, I don't like that answer. Because this is the Smalltalkers' mindset (on average), things like LSP implementation (or other support) for external editors[1] never gained traction.

Without writing an $EDITOR-GT wiring yourself, the best you can currently do is some level of external integration. You can add a context menu option like "Edit in Emacs" in GT that will run emacsclient on a temporary file with the method body dumped. It's obviously underwhelming: you have either a powerful editor (Emacs), or a smart editor (GT), and you have to deal with two completely different UIs. Yes, it's bad. It's still better than trying to use just GT for all editing, though.

I ended up structuring my GT project a bit like a Web app. The sources on disk are a source of truth, and coding agents work with them. I have scripts that load the Git repo into a fresh image and either run the tests, run a one-time eval, or open the GT GUI (equivalent of loading a page and opening DevTools in the browser). In GT, I have an Emacs escape hatch for editing, and I use the Git tool to export any changes back to disk. So far, it works OK, though it's closer to how you work with Common Lisp images than traditional Smalltalk "100% in-image" development. It's not ideal, but it allows me to leverage GT while still integrating other tools into the project.

[1] There were attempts in the past; for Emacs, somebody wrote a frontend to Smalltalks called `shampoo`. It's been 14 years since the last commit.

Re: Malleable computing, Emacs, and you

#56

Earlier quoted context omitted.

I follow GToolkit from time to time but each and every time I'm a little disappointed there's no code editor with LSP integration like Emacs has major modes for programming. I (think I) understand where they're coming from that GToolkit should be used to build tools to inspect and analyze your codebase and problem domain but I feel that it's such a heavy investment to make (kinda like Emacs) and I don't receive that…

EDIT: Argh, I misunderstood your point: you'd like to use GT as an IDE for non-Smalltalk code, right? I took "LSP integration" to mean "GT providing LSP server implementation", while you meant "GT implementing an LSP client", I think. That's not something I ever thought I needed, though there is some support for syntax highlighting for JavaScript and Python, I think. I don't think GT is supposed to be a general-purpo…

Yep, I'd like to use GT as an IDE for non-Smalltalk code like I currently use Emacs though the off-topic rant is very welcome too and I thank you for it!

Regarding the point of Lepiter vs Org I gave GT another go after I posted my comment and I realized that with the power of "adornments" (which you've mentioned) and so on Lepiter can be more flexible than Org files in a way (though the HTML export seems to ignore outlines currently). If I understood correctly there's nothing preventing you from mixing blocks of Markdown and Org (if Org was implemented) with other custom made blocks (like a snippet of code, chart or view of a GitHub repo). In that regard Lepiter (and GT by extension) seems immensely powerful even if I can't summon spell-checking willy-nilly like I can in Emacs regardless of org-mode or dart-mode for example.

Also there seem to be official examples which I didn't see last time that hint about the possibility of implementing text editors and potentially code editors with LSP integration.

https://book.gtoolkit.com/controlling-completion-in-a-text-e...

https://book.gtoolkit.com/editing-python-sources-through-the...

Re: Malleable computing, Emacs, and you

#57

Earlier quoted context omitted.

EDIT: Argh, I misunderstood your point: you'd like to use GT as an IDE for non-Smalltalk code, right? I took "LSP integration" to mean "GT providing LSP server implementation", while you meant "GT implementing an LSP client", I think. That's not something I ever thought I needed, though there is some support for syntax highlighting for JavaScript and Python, I think. I don't think GT is supposed to be a general-purpo…

Yep, I'd like to use GT as an IDE for non-Smalltalk code like I currently use Emacs though the off-topic rant is very welcome too and I thank you for it! Regarding the point of Lepiter vs Org I gave GT another go after I posted my comment and I realized that with the power of "adornments" (which you've mentioned) and so on Lepiter can be more flexible than Org files in a way (though the HTML export seems to ignore ou…

> In that regard Lepiter (and GT by extension) seems immensely powerful

Yes - I think this all comes from the insistence on using a single rendering tree for everything displayed on screen. It allows mixing all kinds of UI elements everywhere, including nesting of arbitrary widgets inside a text field (and arbitrary text inside any other widget). It's a genuinely powerful model for UI composition :)

> I can't summon spell-checking willy-nilly like I can in Emacs

Yes, that's why I mentioned "features I use regularly in Emacs which are (and will be, for a long time) missing in GT" - it's not that you can't build them; they just need to be built, and with how few developers work on GT, it'll take ages before GT Coder gets those features.

It doesn't help that GT editors seem a bit less ad hoc scriptable than Emacs. I'm not sure why this seems to be the case for me - I suspect the need to structure everything as classes and methods adds non-trivial cognitive overhead for simple scripting. At least compared to the pretty flat, procedural shape of typical Elisp code. Then again, I did not invest enough time into learning how to customize GT's editors, so it might be a shallow impression that would go away with time.

> Also there seem to be official examples

Oh, nice, thanks, I missed that. I mean, it's obviously possible to implement an LSP client for GT, but I didn't know one existed. I'm especially interested in how that is integrated into Coder, since it should be able to provide a lot of functionality that I'd also want to script in my custom Coder instances.

Post reply on HN