Hacker News new | past | comments | ask | show | jobs | submit login
Glamorous Toolkit: Moldable development environment (gtoolkit.com)
130 points by homarp on Oct 19, 2022 | hide | past | favorite | 37 comments



This recent video does a good job of illustrating some of the power of what they've built: https://www.youtube.com/watch?v=jJhfTUSDlR0

I find the gtoolkit interface a little clunky in a way I can't quite describe but the core ideas are fascinating:

- if you're looking at a compiled method it's trivial to switch between different representations: you can easily look at the original source or the AST or the bytecode. It's also easy to write your own representations.

- the same applies to all other objects: it's easy to write views which let you query and visualize your application's object graph in the ways which are most useful to you

This sounds a lot like the lisp pitch: While you write your application you're also writing the tools which make it easy to write and debug your application. In Lisp you do this through molding the language; in GToolkit you do this through molding the IDE.


It's really interesting to see all of this visualized. I used to do a subset of these things when I used to reverse engineer games. Reverse engineering all the object structures, injecting a DLL, pointing at those objects and then exposing them via lua or angelscript. Maybe making an interactive REPL like thing so I could play around with things.

I wonder if instead of binding to lua/angelscript, you could instead somehow expose the reverse engineered objects and such to this system to get a nice customizable/programmable UI.

I have 0 understanding of how this system functions at the implementation level, as in how much it relies on the underlying language/runtime/whatever. I know very little about Pharo or how it's actually implemented, just that it's inspired(?) by smalltalk (which I also know very little about). But it looks really cool and makes me excited thinking about the different possibilities that it could potentially open.


You can already connect Glamorous Toolkit to JS and Python to work with objects exposed by their runtimes :)


That's a different use case, where you have access to the source. I'm more thinking for exploring memory objects of games (that we don't have the source access too) to visualize the relationship between the objects in the game and help teach reverse engineering and memory models.

A lot of (some?)people are interested in modding games (with no mod support), but have no understanding of C/C++ or memory models. Trying to explain the levels of indirection of all the objects is difficult without visualization.

Are you the author? Where does the connection to the JS/Python runtimes happen? I looked through the github repos, but I am _very_ far out of my depth. I wanted to see what the API looked like, maybe it's something that could be implemented fairly easily.


Indeed, I am one of the authors :).

The connection to other runtimes happens through an instantiating of a more generic proxy model. The same mechanism also enables us to connect with debugging interfaces as well. So, if you have a way to get the memory layout from a runtime, it should certainly be possible to play with it in GT.


Wow, I love the idea of using GT for reverse engineering. That would’ve been life-changing for my last experience, where I worked mostly in a hex editor. The context switching and slow feedback cycle were brutal. Documenting my growing understanding/implementation with live custom visualizations would’ve been awesome. Unfortunately, that was twenty years before I discovered GT!


Can you post a link to the docs regarding python? it isn't listen on the docs and this very comment comes in third place after the google search.

Docs link: https://gtoolkit.com/docs/


Indeed!

> I find the gtoolkit interface a little clunky in a way I can't quite describe

I would so love to expore with you what makes it feel clunky. Please do feel free to contact me directly https://twitter.com/girba.


> While you write your application you're also writing the tools which make it easy to write and debug your application.

I wonder if the benefits of GToolkit would go beyond using it to extend itself through Pharaoh. Would it be just as useful for writing C++ applications?


People are using it for various systems and for a variety of use cases that go well beyond programming with Pharo.

For example, there are connections to JS and Python out of the box for executing, inspecting and debugging. These are mere examples of what one can build with the environment.

In any case, the first target of our work is to help people discover and practice Moldable Development which is a generic approach to software engineering.


https://gtoolkit.com/docs/analyzing-cpp/

It has a C++ parser already, something could be built on top of that to help turn it into a proper C++ editor. Perhaps turn it into a structure editor. And it can start OS processes so you can use your existing build tools and such.


Why spend days of actual work when you can spend years automating / customizing your workflow


Ugh, do I fall into that rabbit hole often! The thing with GT, though, is that the cost of creating visualizations is so low - a few seconds - that it’s rarely a distraction


this is my curse actually


I struggled initially to understand what this was about. Then, after digging a little bit more, I see that it is an open and rich environment to visualize (while executing) data from different perspectives while being extensible from within the same environment (using Pharo), allowing to create a rich and custom ecosystem for data and systems exploration in an orderly and structured manner.

What I couldn't find is information about workshops or forums besides discord to talk and understand about its possibilities.

Specifically, I had trouble understanding how to apply it to other programming languages and their frameworks. I can see that for some of them (e.g. PHP) you have to export the project with a tool and then import it into GToolkit, but that converts such a system into just an static structure to be analyzed, but not a live system to experiment with. This would mean that live documentation would require permanently exporting and then importing the code from such system. To get a living system + its real time perspectives and embedded live documentation it seems you must program the system in Pharo.


Thank you.

As someone who gets distracted way too much I usually require that a project can demonstrate why it might be interesting at a glance and this one failed pretty hard.

Luckily it was on HN so I could come to the comments to see if it was worth looking into more deeply - but ideally it should be able to do that by itself.

My choices were either 37m video - or a bunch of text that seemed too abstract and didn't explain "what this does" in a concise, down-to-earth manner.

Also mentioning "Smalltalk" would have been a really useful thing. The fact it sounded Smalltalky and I vaguely remember reading about Pharo was my only clue. The minute I understood this was related to Smalltalk a lot of other things fell into place.


I tried running this, maybe 4? months ago when it was posted on HN. I use JetBrains + PHP.

After two hours of trying to follow incomplete instructions, downloading special IDEs and plugins, hunting for alternatives to dead links, etc, I gave up on the process.


Yikes, that sounds frustrating. Did you download one of the binaries from https://gtoolkit.com/download/ ? Also, what OS are you on?

For me, the Mac (both ARM and Intel) binaries have consistently “just worked“ for the past 2+ years


This feels like a continuation of STEPS(STEPS Toward Expressive Programming Systems) project by Viewpoint Research Institute, which produced a universal document viewer and editor called Frank: http://www.vpri.org/pdf/tr2012001_steps.pdf


I read most of the website, and I still have no idea what this is? Is this a Smalltalk IDE? Some kind of static analysis software?


I doubt there is a single good answer to that question. I'd call it a workbench for software and knowledge management, but I am well aware that this doesn't mean much for people who have never used a workbench for software and knowledge management.

A more pragmatic answer: - If a Smalltalk IDE is what you are looking for, give it a try. Right now. You won't regret it. - If static analysis of large code bases is what you are looking for, explore the current level of support for your language (best done by asking a question on Discord), and if it's good enough, give it a try. Otherwise, check again later. - If you are interested in new approaches to software and knowledge management, give it a try, right now, but be prepared to invest some time before you "get it".


Very interesting question, and one that we are struggling to address :).

It's those and more. It's also a programmable knowledge management system. It comes with playground snippets and debuggers for several languages, like JS and Python. More recently it is also a distributed Smalltalk that can be debugged remotely. It comes with a graphical stack that unifies editors with visualizations. All these in a single uniform (and not too large) environment that shows that programming, knowledge management, API management and data science can all be served in a single uniform environment.

These are just the large pieces. Yet the goal is to empower people to create their custom system-specific experiences. Actually, we go as far as to create object-specific experiences. The goal is to help people make the inside of their systems explainable through the practice of Moldable Development.


It's such a challenging problem developing the elevator pitch.

For what it's worth (which is likely very little) the main takeaway I get from the above (in true HN style, without having read the article) is the call-out to knowledge management.

Perhaps because the other bits sound like cool tech you must have built in order to pursue other goals. Who wouldn't want a distributed engine you can debug remotely! I suppose I have some sales hat on. Who could I sell what to?


You're not alone. I ended up on their YouTube channel thinking a demo / tutorial might clear things up.

https://m.youtube.com/watch?v=vtD-xD0Eo3c


It's a suite of extensions of the Pharo Smalltalk environment that are tailored for modeling behaviour and data in multiple ways, such that you can build your own toolkit for your own problem domain.


Jack Rusher mentioned the Glamorous Toolkit in his talk "Stop Writing Dead Programs" https://www.youtube.com/watch?v=8Ab3ArE8W3s

  And here we have the Glamorous toolkit. This is Tudor Gîrba and feenk's thing. They embrace this philosophy completely. They have built an enormous suite of visualizations that allow you to find out things about your program while it's running. We should all take inspiration from this. This is an ancient tradition, and they have kind of taken this old thing of Smalltalkers and Lispers building their own tools as they go to understand their own codebases, and they have sort of pushed it – they've pushed the pedal all the way to the floor, and they're rushing forward into the future and we should follow them.


Looks like a type of structured code editing. https://en.wikipedia.org/wiki/Structure_editor

I think that software engineering should have moved on to this years ago. And maybe they tried but programmers are subconsciously afraid of being accused of being mere users and so want to have colorful complex text in front of them at all times. I a also subject to this.


There is indeed support for structural editing, but we start the environment from the viewing use case. There are many ways to view data (or programs) and these are much less expensive and approachable than editing. For example, the distribution alone comes with thousands of object views. These then enable us to answer questions about the system without reading code (which happens to be the single largest expense in software engineering today).


I'd love to give it a try. However, Pharo still doesn't run out of the box on my Fedora system. It used to work, up to Pharo ~5-6, then stopped working altogether. There's little documentation around installation and even less info on troubleshooting. I'd love to like Pharo, but it simply doesn't work, and nobody cares :( From my memories of it, even when it was still starting properly, it worked... Well, some of the time. Resizing the default font killed the looks of all UI elements, for example.

It's all fixable with enough time and effort, no doubt. Unfortunately, I don't have that kind of time on my hands anymore. I'd love to see and use all the new shiny tools developed in and for Pharo, but - even if it started working again - I don't have the time to read all the code and piece the puzzle together on my own. Some kind of documentation would be nice. Hopefully, included in the distribution. No such luck as far as I can see.

So, even knowing that I'm missing out on some really cool things, I recently switched my Smalltalk development to Cincom® VisualWorks© Smalltalk (I hope I got these Rs and Cs right...) It's a version from 6 years ago at this point and partially closed-source, but it's rock-solid and stable, very well documented with thousands of up to date (easier to provide when you're working with a stable system) pages in PDFs, with guides and references; comes with a lot of goodies and working, well tested support for namespaces, inner classes, visibility modifiers for classes, extended streams (though they're closer to RxJava than classic streams, and I didn't like them very much), some other language extensions (no traits though), the GUI painter, and so on. And all of that works, even if some of it looks less glamorous then the screenshots presented here, which are all I'll ever see of this toolkit until Pharo starts treating users with a bit of basic respect.

I have a blog post about making VW IDE a bit prettier - just look at the screenshots: https://klibert.pl/posts/smalltalk-ide-quickfix.html - yeah, it looks so last-gen, right? I know. But it works. And it survived like 3 system upgrades, 1 reinstall and 1 fresh install on a new laptop without issues. If only Cincom was more flexible when it comes to licensing the commercial version!


Glamorous Toolkit build the VM differently from Pharo. Please give the distribution a try: https://gtoolkit.com/download/


It worked! Not sure why or what's the difference, but Pharo downloaded from here: https://pharo.org/download still doesn't work - it opens a window but never draws anything in it, it's stuck showing whatever was below it and never updates.


Glamorous Toolkit is based on Pharo, but it is a separate project with its own build system and even graphical stack. I am glad it works for you. Feel free to ask questions.


What is the main difference in your build approach? Are there any major changes to the underlying VM?


In GT, the Pharo VM is like a library, not the main executable. We have two threads: one that runs the UI rendering and one that runs the Pharo image. Also, our build infrastructure is coded in Rust, and all VM libraries we create are written in Rust as well.


Ah so is the UI written in Smalltalk? Or Rust?


The low level rendering is handled through Skia and it's hosted in windows handled by Winit. But all the high level model is in Smalltalk.


Oh, OK, I'll try. Thanks for letting me know! :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: