You are viewing archived messages.
Go here to search the history.

Jimmy Miller 2024-12-26 16:27:19

Finally getting to work on beagle again. I was able to get some Cffi working. So here you see a simple sdl application and a socket server on a background thread. I made a quick vs code extension that sends the contents of a buffer to this socket and the code evals. Now I have a quick and simple live coding setup. Here I just invoke a function, but you can redefine functions as well. I need to work on live redefinition of structs and all sorts of bugs and edge cases. But it's pretty exciting to see some real stuff working!

live.gif

Kartik Agaram 2024-12-26 20:16:41

What is beagle? It doesn't look like you've mentioned it here before..

Jimmy Miller 2024-12-26 20:17:59

Ahh, yeah sorry. I've named my language I've been working on Beagle. So all the previous posts about a dynamically typed functional language I'm working on is about that.

Erik Stel 2024-12-28 23:04:46

Just so you know, there is also Beagle Smalltalk by David Buck.

Roma Komarov 2024-12-26 22:47:58

Working on a native CSS mixin that would allow to easily debug any other custom properties in CSS by outputting their value into ::after pseudo-element. It is sometimes frustrating doing various complex calculations in CSS while not seeing the result itself (without applying it to something), and without looking into devtools (which is nice, but can be slow). So, being able to just output some CSS variable, calculation, viewport, or container unit for any element just by assigning a single CSS variable will be very useful.

(the code for achieving this is overcomplicated — but 100% fine for debugging purposes; I'll try to write an article about it in the next few weeks)

Ivan Reese 2024-12-26 22:49:32

That's wild. Can't wait to see the technique. Is it using attr() ?

Roma Komarov 2024-12-26 22:52:25

Nope! In the screenshot, the left part is displayed with attr() , but the right part is “calculated” from the value of the variable and then output as CSS counters. Basically, the only way to output values from variables in CSS into content , and there is a lot going on in order to achieve this haha.

Tom Larkworthy 2024-12-28 17:49:32

got the notebook cell visualizer finished. Its the final part MVP part for an userspace Observable-like experience off the platform, but I still need to actually put all the pieces together so its not hugely interesting yet observablehq.com/@tomlarkworthy/visualizer.

Oleksandr Kryvonos 2024-12-29 13:55:45

so previously I created a small tool that creates commits on every file change

and though it was very fun in the beginning it turned out to be a trouble to remember what I actually did

so now I downgraded it to just "create a new feature branch if I make some changed on main branch and stage everything"

github.com/uprun/git-auto-commit

Paul Tarvydas 2024-12-29 21:05:13

Comments? I often do exploratory programming and end up thinking "this worked just a 1/2 hour ago, maybe I should revert to that?" (Or "...just yesterday..."). I am learning to hate off-the-shelf git. I have always thought - but haven't done anything about - that I want an auto-git that saves every change and lets me rewind. Is this the kind of thing that you found to be too much trouble?

Kartik Agaram 2024-12-29 21:12:49

Paul Tarvydas I pointed out 💬 #devlog-together@2024-11-25 my idea of creating a commit at the point of a comment to self. I still like this approach a lot even though I stopped using it at some point as I grew more fluent with git.

I suppose it depends on what the goal is. In that previous thread the goal seemed to be to see a very fine-grained history. Oleksandr Kryvonos I don't follow what you mean here by "it turned out to be a lot of trouble to remember what I actually did". Doesn't the commit history show you exactly what you did? Is it just too noisy?

It seems to me the current approach of staging things drops the fine-grained history entirely. So maybe I was misconstruing your goal above. I'm curious to hear more.

On a tangent, I was reading about magit yesterday. I wonder how much of a difference using it would make to the experience of git.

📝 Emacsair! A walk through the Magit interface

Blog of Jonas Bernoulli

Oleksandr Kryvonos 2024-12-29 21:19:07

Kartik Agaram previous goal indeed was to have a fine-grained history, but it was noisy

Oleksandr Kryvonos 2024-12-29 21:29:14

Paul Tarvydas in my workflow I always can roll-back to stable version - this is my "main" branch.

Now when I start to explore I create a new branch first,

but making commit on every change ruined already available diff tools

so this was one of the problems with previous approach.

Kartik Agaram 2024-12-29 21:30:36

Has the goal shifted now? What is it now?

Paul Tarvydas 2024-12-29 21:33:44

The way that I read this, it sounds like you have to stop and make a comment to self, pulling yourself out of "The Zone" (aka "Flow state"). Did I understand this correctly? If so, I want to aim for tools that don't interrupt my train of thought. An aspect of "exploratory" programming is that it is not methodical, you can't plan ahead nor push buttons after/before-the-fact, you need to keep motoring forward without needing to notice your tools.

Oleksandr Kryvonos 2024-12-29 21:43:53

Paul Tarvydas yes it is correct - now I will need to get out of the flow "The Zone" and write the comment myself.

Oleksandr Kryvonos 2024-12-29 21:46:26

Kartik Agaram the global goal is to explore what works for me in programming and I am thinking of a short-lived project as a means for exploration. I thought that granular history was what I wanted but it was a mistake for me.

Kartik Agaram 2024-12-29 21:48:51

I'm definitely interested to hear more as you figure out what you want for yourself.

Have you looked at jj ? It has an interesting-looking flow where every edit is automatically part of an automatically updating commit -- until you decide to draw a line and create a new one. I haven't worked much with it myself, but in principle it seems like a promising best of both worlds: save from the start, but you aren't forced to prematurely attach a name to what you're doing.

Paul Tarvydas 2024-12-29 22:01:46

Oleksandr Kryvonos I conclude that "staying in The Zone" is vital during design and exploration. Most programming languages and IDEs don't emphasize this aspect and tend towards a "waterfall" model of development, i.e. you need to predict where you're going instead of simply discovering it. This sounds loosey-goosey, but is critical to actual design work. It might be a big factor in why some people love early languages like Lisp, Smalltalk, Forth, etc.

Oleksandr Kryvonos 2024-12-29 22:04:57

Kartik Agaram thanks for the suggestion,

I try to use Unix philosophy of "one condenced and understandable tool for one job".

Next I want to create a pattern matching natural language agent similar to ELIZA ( github.com/norvig/paip-lisp/blob/main/docs/chapter5.md )

Oleksandr Kryvonos 2024-12-29 22:06:58

Paul Tarvydas totally agree that staying in the mental flow is important.

And that environment should support fast iterations.

Paul Tarvydas 2024-12-29 22:39:21

Oleksandr Kryvonos are you aware of Prolog, miniKanren, Nova, Ceptre, etc., for pattern-matching? That stuff was shunned in 1950 because backtracking was considered too taxing on the hardware. Today, backtracking is cheap and cuts through problems like Eliza like a hot knife through butter. [I conjecture that LLMs are just massively parallel pattern-matching devices].

Oleksandr Kryvonos 2024-12-29 22:55:58

Paul Tarvydas yes I am aware of Prolog, the other names are new for me

Kartik Agaram 2024-12-29 23:17:57

After a conversation with Jack Rusher and others about Emacs Nature, and playing with Seymour by @Alessandro Warth, I'm getting interested in building..

An environment for visualizing programs

(Not to be confused with visual programs, or visualization more generally.)

  • Start with a tiling window manager for managing named graphical canvas "buffers", using Emacs operations like split and resize.
  • Each buffer exposes a coordinate space of its choosing, listens for messages and positions objects in the space in response to messages.
  • Buffers can send messages to other buffers.

Examples, etc. in 🧵

Kartik Agaram 2024-12-29 23:44:24

Examples of coordinate spaces:

  • Graphical game engines use the obvious 2D/3D cartesian systems. You position stuff using (x, y) or (x, y, z) . You could also imagine polar or other coordinate systems that are studied in geometry.
  • The HTML DOM is a space where positions can be specified using CSS selectors or XSLT.
  • You can imagine a text editor operating in a coordinate space as well. Emacs seems to use a 1D coordinate, just character count from start of buffer. My stuff so far uses 2D: (line index, UTF-8 codepoint index within line)
Kartik Agaram 2024-12-29 23:58:13

Example messages:

  • In a text editor, the cursor tracks a position, and keyboard and mouse send messages to move the cursor or insert objects (characters or longer text) at the cursor.
  • You can imagine print statements as a message from the "code" coordinate space to a different, 0-D (append-only so there's no notion of coordinate) space.
  • Terminal buffers in Emacs take the mostly 0D space of a terminal and augment it with a cursor. When you scroll up to an earlier command and hit a hotkey, the buffer sends a message to itself with the text around the cursor. The message is received at the bottom of the buffer.
  • Emacs Slime and other IDEs support keyboard shortcuts to send text from the current buffer to a REPL in some other buffer.
  • Ronin and sketch-n-sketch support bidirectional messages between two spaces with very different coordinate systems.
  • Live programming systems often show the results of a statement to its right. Examples: alv by Sol Bekic, Bret Victor (of course), Seymour as above. These too can be seen as a reflexive message from a space to itself. In addition, the message contains an implicit coordinate: the current line.
  • GToolkit, Lisp Machines and other Smalltalk systems do a lot of stuff like this. I think all of this can be cast in terms of buffers, coordinate spaces and messages, though you can imagine them as a single, very complex coordinate space like the HTML DOM, or many simple spaces with different possible coordinate systems. For example, in any of them you can create a new "log" space that you can append graphical objects to. Maybe even self-contained interactive graphical widgets.
Kartik Agaram 2024-12-30 00:05:48

The major question for me now is: how do you configure a buffer? You need some concise way to specify the space (perhaps just by naming from a small menu of options), handlers that listen for messages (e.g. keypress or mousepress), handlers for sending messages (e.g. widgets on the space that perform tasks when you interact with them), and generic handlers for sending messages to other buffers (e.g. print ; here I'm imagining it to send a message from some arbitrary process, through say a socket, back into the environment, with enough information to route it to the appropriate buffer accompanied by a reasonable coordinate)

Tom Lieber 2024-12-30 02:15:52

Elena and I explored this space a little and you might find a useful thing or two in github.com/alltom/debugview

I think session management was the most annoying part of our approach. Like if two parts of a program want to make bar charts, suddenly there was a coordination problem, because we wanted to stick to a tadi protocol that any process with a stdout could speak and wouldn’t require a library to effectively use.

Konrad Hinsen 2024-12-30 06:49:58

Buffer configuration is what Emacs has modes for, and Smalltalk objects (what else?). In both cases, it's a finite but possibly large list of choices.

You could have Emacs-like modes and have programs specify their mode in an initial message.