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

Paul Tarvydas 2024-11-05 20:43:01

Exploring / fooling around with making a REPL for drawware (inspired by Ivan Reeseโ€™s reference to the paper Advanced Game Engine Wizardry for Visual Programming Environments.

Surprising revelation: On the same computer, using just a websocket to connect a browser-based GUI to a Python program which interprets the diagram by shelling out results in turn-around that is "fast enough". It looks instantaneous. No further optimization, nor premature optimization, is required. Biggest missing feature at this point: a change to the diagram should cause the Python program to recompile and re-run the diagram and to update the output fields on the GUI. I think that this could be done by having the Python program periodically sample the 'test.drawio' file timestamp. I know that this is possible, but, I haven't worked out the details yet (suggestions welcome).

open.substack.com/pub/programmingsimplicity/p/beginning-to-work-on-a-repl-for-drawware?r=1egdky&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true

Tom Lieber 2024-11-07 04:28:55

People who were interested in my probabilistic programming language project for the statistics might enjoy this sprawling post where I dig deep into the guts of the surprisingly approachable inference algorithm underlying it:

alltom.com/pages/spawelo

Cool problem โœ…

Cool model โœ…

Cool algorithms โœ…

Kartik Agaram 2024-11-07 05:13:03

Hey this is unrelated. I have a question about PPLs: have you heard of anyone using them to implement the Chaos Game?

๐Ÿ“ The Chaos Game

The term โ€œChaos Gameโ€ was coined by Michael Barnsley [1], who developed this ingenious technique for generating mathematical objects called fractals. We have discussed a particular fracโ€ฆ

Tom Lieber 2024-11-07 15:15:07

Nah, I havenโ€™t heard of it. Iโ€™m curious, though. Bookmarked.

Pietu 2024-11-07 16:56:02

Hi all ๐Ÿ‘‹.

I've started a project to try out some of the ideas I've had regarding markdown and writing.

The perspective I'm coming from is that I've found it difficult to write technical articles. Especially ones containing code examples. The cut-n-paste nature of building such articles usually results in some files missing, broken code or incorrect output.

I've had a bad habit of not sharing what i'm doing, so this time I want to share baby-steps i'm making with the project. It's very barebones. I've got the first feature (if you permit) working, so the below video demonstrates includable blocks.

Kartik Agaram 2024-11-07 17:16:35

This is great! Elements of Block Protocol and Literate Programming combined together in a new and interesting way.

Pietu 2024-11-07 17:46:58

Literate programming is definitely one source of inspiration! This is a form of "within-document tangling". Next is treating filenames and ID's interchangeably so that files can be included.

There are some interesting graph problems in that.

Pietu 2024-11-07 17:47:34

Oh, and the project lives here on github if anyone is interested in the source. There is quite a lot of it compared to what it does so far...

Albert Zak 2024-11-07 20:00:44

Beautiful! You built something I dreamed of a few days ago. Loving the natural and terse ... syntax for placing snippets, and the simple piggybacking onto md's image tag. Why is your code in blockquotes though instead of triple-backticks? Very interested to see how you approach file tangling. Filesystem-to-editor unidirectional inclusions will probably be easier than the other way round. Do you think bidirectional editor<>filesystem tangling would be possible at all? Maybe tracking modification timestamps?

Pietu 2024-11-07 20:42:35

and the simple piggybacking onto md's image tag.

There's some level of depth in this one which i'll expand upon. The original inspiration (unspiration) was that GitHub added support for a syntax like this some time ago. This was how the syntax got started.

In fact, one of the goals is to be superficially markdown-compatible. I.e. headings, lists, even "NOTE" blocks should be valid both in this project and on GitHub....

Why is your code in blockquotes though instead of triple-backticks?

...but that's where the superficial compatibility with markdown ends.

This project is a playground for a few ideas i've had. One of them is related fascination over languages that don't have explicit "start" and "end" tags or fences (backticks). Hence, one of my explicit goals was to get to something that won't need me to use closing tags (i'll have to write design goals down some day).

It's a fun challenge! However, like you immediately noticed, using > is janky. The future solution to this is three-fold:

  • First, a block can be started by one of many characters. Blocks are generalizations of what markdown calls "lists", "headings" and "blockquotes". That means, lists are blocks (of semantic type LIST , and so on.
  • Second, supporting Markdown's "original" syntax of two-space indentation for starting a (code) block, which would make the current example almost "normal".
  • Third, i have something i call "sections" that are allowed on the root level. Hopefully i'll get to demo those in a few weeks.

Very interested to see how you approach file tangling. Filesystem-to-editor unidirectional inclusions will probably be easier than the other way round. Do you think bidirectional editor<>filesystem tangling would be possible at all?

I have some initial parts of this in my design, but the devil is in the details. It's one thing to support "a" editor, and another to support "any" editor. What you see on the video is an editor in the browser. I'll focus on that for now, but following filesystem events would be cool.

I've approached the architecture like a build system. There's an internal graph of tasks (think: load, parse, render) that should allow for both tangling (writing out) to filesystem, as well as loading in (weaving).

Loading already works somewhat, but working with graphs is tricky, and we'll see what's possible.

Maybe tracking modification timestamps?

This is definitely one key piece in there. Not sure what else, tracking syscalls?

Pietu 2024-11-07 20:50:03

One more fun thing is how to compose many includes in one place, here's what works already:

image.png

Albert Zak 2024-11-07 20:50:45

Thank you for your thorough reply. Super excited follow your progress on this. Can you say more about why you wish to avoid explicit end markers?

Pietu 2024-11-07 21:39:26

Can you say more about why you wish to avoid explicit end markers

For fun mostly! But also, because I spent some time thinking too deep about what why Python chose to use indentation for scoping. There are some interesting properties, if you do "what python did" but for a markup language.

For example, there can not be "too many right parentheses".

This is useful, if you do collaborative editing. Consider what happens when someone writes <div> in a collaborative html document. All lines after it are potentially affected, until a </div> is added (some time later). So someone editing content at the begining of a document can break a document for someone editing the end. Using a no fences, or "line-based" or "indentation based" language alleviates some of these issues, at least in naive cases.

...But mostly for fun!

Kartik Agaram 2024-11-08 00:01:51

I have gotten annoyed by timezone calculations ๐Ÿ’ฌ #present-company@2024-11-07. Here's a static html page you can download and save locally to roughly compare times in different timezones (just hours; you're on your own for minutes)

The way I'm naively imagining using this:

  • Scroll to the timezone you know the time in.
  • Click on the nearest hour.
  • It'll highlight that column all over the page.
  • Scroll or find the timezone you care about.
  • If you're not in a whole-number timezone (Hello India), you'll need to do some additional mental arithmetic by comparing nearby rows.

Right now you need to know if you're currently in Daylight Savings Time. Which is often beyond me, but I'm not yet sure what to do about that..

Inspired by Bret Victor, but of course the inevitable mistakes are all mine.

Ivan Reese 2024-11-08 02:00:00

Lately I've felt a lot of "big feelingsโ€ โ€” pain, yearning, confusion, frustration, desire โ€” about computer programming.

I can't quite explain how I feel. Certainly can't write it down. Most definitely not in brief.

So I did the only thing that comes naturally: felt my way through it, out loud, exploratively.

Titles are hard, so it's called "Live as in Aliveโ€, perhaps glancing sideways at the recent d-d-discourse about live programming vs live coding.

40 โ€”> ivanish.ca/hest-podcast

Jason Morris 2024-11-08 05:12:25

That's a very helpful explanation of the why of hest, actually. I think I get it now, in a way that I didn't get it before. You don't want to rewind like scrubbing a video, for example. You want to sort of tilt the world, changing the direction of gravity's pull, and have the river of computation pour back up the hill. Because hell yeah.

Ivan Reese 2024-11-08 05:16:20

Yes. It's not taking you back to an earlier state, it's executing things in reverse. And if you changed the data manually, executing in reverse takes you to a state you hadn't been in before.

Just to double-check โ€” did you listen to episode 40, or 38?

Jason Morris 2024-11-08 07:58:17

You could do some kinds of logic programming by designing molecules with two different types of binding sites, where each binding site has a graph diagram that represents a logical clause, variables on all binding sites are connected, you throw copies of these molecules into a solution, catalyse a query molecule type to do backward chaining, catalyse a fact molecule type to do forward chaining, catalyse a rule molecule type to do middle-out chaining, and agitate the solution so catalyzed molecules will be attracted to and bind to other molecules with a graph diagram that unifies on the opposite binding type. As you agitate, you get a preview of the new molecules being formed. When you remove or run out of catalyst, any newly formed molecules with empty binding sites dissolve, and the remaining new molecules represent answers to your query. "Stable model constrained answer set chemistry." ๐Ÿ˜…

Maikel van de Lisdonk 2024-11-08 08:25:04

Thanks for this episode Ivan Reese .. I recognize the feeling of missing that liveness that you describe (I've very intensively played with ableton in the past and off course I recognize the experience of dealing with css .. which is much different then regular programming. My first paid project was a game actually .. in 1991 .. but in a pretty dead programming environment: 6510 assembler). When I see the dots moving in my own project (code flow canvas) and play around with the timeline slider and make changes I do get a bit of an "it's a live" feeling myself.. but I know it's far from that. I want more of that for sure ๐Ÿ˜Š . So I keep exploring as well ๐Ÿ˜„

Jason Morris 2024-11-08 17:32:50

It was 40! The reversing time thing is just an example of what I feel like I hadn't grokked before.

๐Ÿ•ฐ๏ธ 2024-11-03 20:23:39

...

Tom Larkworthy 2024-11-08 22:00:23

It loads so fast I had to make it load faster, also the fact it did not work offline was annoying me. I've added the ability to bundle Observable FileAttachments to support images, but this also unblocked me to include static JS libraries, and then eventually supplying Observable's builtins as file attachments, but gzip compressed. So the final result is it expands to 300kb, but all dependancies are gzipped inside the page.. no CDN fetches or DNS stalls => sub 100ms loading time! For comparison the same notebook takes 3 seconds to load on Observable. I think the core tech is done, now I switch to ironing out some remaining warts like some of the cells get unnecessarily reordered.

image.png

Paul Tarvydas 2024-11-09 21:11:22

๐Ÿ“ Experiment With A Simple REPL For A DPL

Towards Higher Level Syntax for Programming Languages 2024-11-09