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

Paul Tarvydas 2023-09-19 01:24:41

Ivan Reese and @Alex McLean mentioned “...hand drawn programming environments...“. The first thing that I think of when I hear this is “whiteboards”. What are the dimensions involved in whiteboards? x/y/t. T goes forwards (e.g. adding new details by drawing them in over time) and backwards (erasing parts of drawings). Iteration. Scrubbing.

Ivan Reese 2023-09-19 06:16:49

My current experience is that polar coordinates are more meaningfully expressive than Cartesian. But is suppose it depends on what you're trying to do. Time, for sure.

Alex McLean 2023-09-19 06:53:00

I like to make mostly stateless systems so that time takes care of itself. You can also treat qualities like the spikiness/compactness etc of shapes as more dimensions, and calculate things based on proximity to each other rather than a global x/y. I am working with a whiteboard tabletop, adding a plotter for feedback.

William Taysom 2023-09-19 19:45:05

Turtle graphics for the win!

Paul Tarvydas 2023-09-20 10:12:06

I would love to know more about your thoughts on polar coords, but, ATM I can’t even formulate a reasonable question... Ivan Reese

Paul Tarvydas 2023-09-20 10:13:20

I keep mentioning “time”, because I learned a deep secret when I was breaking my brain trying to understand Denotational Semantics. The secret is: be very explicit and make everything very explicit as you think. Then, you can always wrap syntactic skins over the stuff, in order to elide the concepts that you think should be elided. In my mind, you can’t know what to elide if you don’t know - explicitly - what you’re dealing with. I guess that this is a kind of Physicist perspective - I want to know what makes things tick, I want to know what the Atoms are. Synthesizing better UXs is easier when you begin with a bag filled with Atoms.

Alex McLean 2023-09-20 10:16:11

One nice thing about polar coordinates is that there's no way 'up', so interfaces afford collaboration with people around a table

Paul Tarvydas 2023-09-20 10:44:49

Hmm, so here’s a question, sort-of... In my mind a “tensor” is just a 3D polar coordinate. Is that relevant here?

Guyren Howe 2023-09-19 17:43:47

Why on earth, in this era of many-gigabyte machines, don’t all programming languages have a time-travel mode for debugging?

Jason Morris 2023-09-19 20:23:44

My guess? You can't take a state, and the program, and then move it one step backwards and expect to get the previous state, because the languages don't have a semantics in that direction in time. So time-travel mode would require a gazillion save files that you could reload whenever you like. And the size of the programs grows to match the available space, so programs run on many-gigabyte machines would need many-terrabyte machines to be able to record that kind of history.

Guyren Howe 2023-09-19 20:36:30

I would be happy with something “relatively simple”: all in memory; keep a list of state value creations, always create new values rather than updating old ones, and turn off the GC.

Guyren Howe 2023-09-19 21:04:03

Ideally, let me have a start-stop call so I can reverse only certain parts of the code.

Guyren Howe 2023-09-19 21:04:30

Yes, you would run out of memory. But you’d use it just through some crucial set of calls and then hit a breakpoint.

Kartik Agaram 2023-09-20 03:08:00

A few years ago I built a computing stack up from machine code that I debugged by emitting a detailed log of every instruction executed and register state at every instruction -- and then browsing the resulting log in a manner akin to time travel.

I spent a long time debugging all sorts of programs with this infrastructure, that requires all of a few hundred lines of code.

If you care to try it out, these instructions should still work: github.com/akkartik/mu/blob/main/tools/browse_trace.readme.md

Konrad Hinsen 2023-09-20 06:22:41

A generic time-travel debugger can be problematic because of resource requirements. So... how about a framework that lets developers add context-specific time-travelling debugging to their code, as a form of instrumentation?

I have done this in Pharo Smalltalk (copying the practice of others, I didn't invent anything in this space), using the Beacon library. It implements an in-memory logging system, which in an image-based language is usually all you need in terms of logging. You can add arbitrary Smalltalk objects to your log. Including stackframes. Which you can inspect in a debugger later on (or process with your own code if that's more convenient).

This isn't quite the same as time-travel because the Smalltalk image consists of mutable objects, to which stack frames only hold references. So if you have global mutable state, you have to add snapshots of it to the log as well, and then it gets messy. If you are careful with globale and/or long-lived mutable state in your overall design, which is good advice in Smalltalk anyway, it's rarely an issue in practice.

Guyren Howe 2023-09-20 06:28:09

Hmm.

My language of interest right now is Dart. They’re about to add macros. I wonder…

Konrad Hinsen 2023-09-20 06:28:51

That's the idea of what Tudor Girba calls Moldable Development : don't give developers fish but teach them fishing. Let them write their own context-dependent development tools, which are both simpler and more powerful than generic ones.

Quoting Christopher Alexander ("The timeless way of building"):

So long as I build for myself, the patterns I use will be simple, and human, and full of feeling, because I understand my situation. But as soon as a few people begin to build for "the many," their patterns about what is needed become abstract; no matter how well-meaning they are, their ideas gradually get out of touch with reality, because they are not faced daily with the living examples of what the patterns say.

📝 Moldable Development

Moldable development

Guyren Howe 2023-09-20 06:42:51

All this aside, it seems a relatively simple way to raise developer efficiency. So why isn’t something for this shipped with every language, either as a built-in feature or as a library?

Konrad Hinsen 2023-09-20 08:16:25

Mindset and lack of awareness. Why implement a feature that nobody asks for, and whose utility potential clients don't even recognize when it's offered to them?

Justin Blank 2023-09-20 10:08:41

JetBrains has been implementing forms of speculation—if they detect a method doesn’t have side effects they’ll show the result of evaluating it before you reach it. The reaction was really positive.

I don’t think they’ll bet the company on it, but I’m confident if they could implement time travel without having to switch languages/re-engineer everything they would.

William Taysom 2023-09-20 13:08:30

I do not write much JavaScript, but Replay replay.io is a very serious attempt at an omniscient debugger. When I used it, the most remarkably helpful feature is that you could add "print statements" docs.replay.io/reference-guide/debugging/print-statements to an existing trace.

📝 Replay - The time-travel debugger from the future.

Record and replay your application with DevTools.

📝 Print statements

Print statements in Replay are your magic wand for debugging. Replay lets you add print statements (also called console logs) to an existing replay with no need to compile or re-run the code.

Tim Lavoie 2023-09-23 00:18:59

OCaml has the "time travel" debugger in ocamldebug, for programs compiled to bytecode.

typeerror.org/docs/ocaml/debugger

📝 18. The debugger (ocamldebug) - OCaml Documentation

Chapter ‍18 The debugger (ocamldebug) 18.1 Compiling for debugging 18.2 Invocation 18.3 Commands 18.4 Executing a program 18.5 Breakpoints 18.6 The call stack 18.7 Examining variable values 18.8 Controlling the debugger 18.9 Miscellaneous commands 18.10 Running the debugger under Emacs This chapter describes the OCaml source-level replay debugger ocamldebug. Unix: The debugger is available on Unix systems that provide BSD sockets. Windows: The debugger is available under the Cygwin port of OCaml, but not under the native Win32 ports. 18.1 Compiling for debugging Before the debugger can be used, the program must be compiled and linked with the -g option:...

Nilesh Trivedi 2023-09-20 08:50:05

@Shobhit Srivastava @Prabhanshu Gupta @Ravi Chandra Padmala and others: Let's have a FoC meetup in Bengaluru? Happy to host in Domlur.

Prabhanshu Gupta 2023-09-20 13:06:18

That’d be awesome :D When are you thinking?

Prabhanshu Gupta 2023-09-20 13:16:17

Some time early October seems nice to get the word out by.

Ravi Chandra Padmala 2023-09-20 13:35:12

I'll have to miss it, I'm traveling until January.

Arvind Thyagarajan 2023-09-20 13:37:42

I'll be back by Jan too, and would love to do this

Arvind Thyagarajan 2023-09-20 13:39:28

If there's quorum, could we have an #in-blr channel Ivan Reese when you have a moment 🙏

Ravi Chandra Padmala 2023-09-20 13:47:04

Or #in-india for those of us visiting from other cities

Nilesh Trivedi 2023-09-20 13:49:49

I suggest having it in Jan so that more people can make it. Then we can have everyone present something: a project, some ideas/questions etc?

Arvind Thyagarajan 2023-09-20 13:52:17

Jan sounds good! Let's jam further once we have the dedicated channel?

Qqwy / Marten 2023-09-20 15:49:42

Hi all! New here, but latest episode of Future of Coding (‘ 66 - a Small Matter of Programming ’) made me think of something closely related.

Part of the discussion was about using formal vs informal language to communicate with a computer, and whether ‘end-user programming’ would be feasible using those methods or not.

One tool which came to mind is ‘Inform’. It is a tool (mainly a programming language, though it also ships with its own IDE-like thing) to write text adventure games.

But rather than being geared towards programmers , it is geared towards writers.

An example of a simple program:

The Cabin is a room.  "The front of the small cabin is entirely occupied with navigational instruments, a radar display, and radios for calling back to shore. Along each side runs a bench with faded blue vinyl cushions, which can be lifted to reveal the storage space underneath. A glass case against the wall contains several fishing rods.



Scratched windows offer a view of the surrounding bay, and there is a door south to the deck. A sign taped to one wall announces the menu of tours offered by the Yakutat Charter Boat Company."



The Cabin contains a glass case. In the glass case is a collection of fishing rods.



The case is closed, transparent, and openable.



The bench is in the cabin. On the bench are some blue vinyl cushions.



The bench is enterable.



The Beach is a room. "A beautiful beach where the sunset can be seen. Some seagulls are flying overhead."

The Beach is south of the Cabin.

Some points for consideration are:

  • Where do you think a language like Inform fall on the ‘formal’ vs ‘informal’ spectrum?
  • Inform is perhaps the most widely used tool to create text adventures with today. Could this be considered a success story where non-programmer end users were able to build something through ‘programming’?
Ivan Reese 2023-09-20 16:45:26

Yes, Inform 7 in particular is a phenomenal success and a major inspiration.

Alex McLean 2023-09-20 17:11:22

I'm also inspired by how well organised development is github.com/ganelson/inform-evolution

Qqwy / Marten 2023-09-20 17:14:52

@Alex McLean It used to be closed-source (though free) and has existed in that state from 2015 to 2022. Very stoked that it is now open source and indeed it looks very organized!

Alex McLean 2023-09-20 17:18:33

@Qqwy / Marten I'm generally very pro free/open source, but do think there is something about developing new ideas in software without the distractions of external input.

Paul Tarvydas 2023-09-21 03:02:10

One has to wonder how LLMs (GPT) might apply…

Konrad Hinsen 2023-09-21 07:06:16

Where do you think a language like Inform fall on the ‘formal’ vs ‘informal’ spectrum?

Preliminary question; what exactly changes from one end to the other of that spectrum? My current answer is: how much of the total information conveyed is formal. I'd love to hear from others who have thought about this question, or know about work on this topic in the literature.

To illustrate my definition, a few examples:

  • Machine code is near 100% formal.
  • Standard programming languages are mostly formal, the informal part being the variable names, which convey context-dependent information to humans but nothing to the compiler/interpreter.
  • Markup languages (HTML, Markdown, ...) are mostly informal, because the formalized information is not the most relevant part. You could strip it away and the rest would still fulfill its purpose.

There are lots of subtleties I am glossing over. Example: A Python program saying print("...") with a 100 KB string is basically just decorated informal prose. My definition applies to typical or intended use, not possible extremes.

Back to Inform: I cannot judge from the example which information is extracted from the code by formal processing. Is this a controlled natural language, like Attempto ? Or plain English from which some engine extracts isolated keywords?

Alex McLean 2023-09-21 08:07:34

Informal aspects of notation are generally known as 'secondary notation' in the psychology of programming literature en.wikipedia.org/wiki/Secondary_notation

Alex McLean 2023-09-21 08:12:10

as part of the cognitive dimensions of notation en.wikipedia.org/wiki/Cognitive_dimensions_of_notations

Paul Tarvydas 2023-09-21 11:16:28

I like to cleave “programming languages” into 2 categories (1) human readable and (2) machine readable.

The task of developing programming languages boils down to figuring out how to map (1) to (2).

I think that the best language for (2) machine readability is Lisp syntax (not necessarily Lisp semantics, which is a different issue). I think that the best language for (1) human readability is a hybrid of box-and-arrow diagrams mixed with text. Currently, I am writing programs in draw.io and compiling them to executable Odin code (thanks to Zac Nowicki). I am using this, also, as a visual shell (VSH) to plumb together Ohm-JS and ‘.RWR’ (“rewrite” nano-DSL) specifications to form transpilers (e.g. Scheme->JS).

I firmly believe in what I learned in Physics - invent multiple notations suited to expressing the task(s) using “simplifying assumptions” and bolt them all together to form solutions using divide-and-conquer mentality.

Konrad Hinsen 2023-09-21 13:40:31

@Alex McLean Thanks for those pointers! This area looks a bit messy: the article on cognitive dimensions says that secondary notation is independent of syntax, and the article on secondary notation quotes syntax highlighting as its first example.

More to the point, I don't see any of these dimensions as being about degree of formalization of the basic notation. It seems to be tacitly assumed that it's a highly formal programming language.

Alex McLean 2023-09-21 13:41:38

I suppose syntax colouring is still independent of syntax in a sense.

Alex McLean 2023-09-21 13:42:11

With the exception of e.g. Piet.

Alex McLean 2023-09-21 13:43:15

Are computer programming languages highly formal by definition?

Konrad Hinsen 2023-09-21 14:55:55

The only definition I am aware of is "formal language", which is defined as a set of symbols plus a set of syntax rules for valid expressions made from these symbols. That definition covers numbers written as Arabic numerals (or Roman numerals if you prefer). It also covers HTML, no matter the contents of the page. And it covers programming languages, which are formal languages with execution or evaluation semantics.

But that definition covers only the formal aspects of formal languages, not the informal aspects that remain outside of the definition. Like, for example, the information conveyed by the variable names of a program.

Alex McLean 2023-09-22 08:38:35

So for HTML would you say that the data is informal language, but the metadata/semantic markup around it is formal language?

Konrad Hinsen 2023-09-22 14:09:19

Yes. XML is a more difficult case, because it is used both as a markup language for textual documents (i.e. Docbook) and as a file format for storing tree-structured data.

Alex McLean 2023-09-21 08:22:15

On another inform tip, I really enjoyed this talk from Graham Nelson, with lots of take-home ideas for making a learnable language that's engaging and open to change youtube.com/watch?v=ZL7HjuFyKeE

Alex McLean 2023-09-22 08:35:39

One thing I've noticed working with Realtalk is that the natural language style tends to have a trade-off in making things easy to read, but a bit harder to write.. You can read them like English sentences but if you try to write them that way you probably will get a connective wrong or some other subtle thing and it won't parse or won't communicate with something else.

More generally I think it's easy to conflate readability and writeability, they're obviously related but still quite different properties.

Actually for a lot of things writeability is far more important than readability. E.g. when live-coding music you don't necessarily have to read/understand exactly what code is doing because you can understand the code by experiencing the results while writing, rather than reading the code.

David Alan Hjelle 2023-09-22 12:47:34

That's interesting — that sounds kind of like an uncanny valley of prose & programming?

(I wonder how Inform manages to escape that trap…or doesn't it?)

Alex McLean 2023-09-22 12:50:50

I wouldn't say it's a trap, just a tradeoff.. and something you quickly get used to.

William Taysom 2023-09-22 14:08:08

Tool support. Consider that beyond concerns of getting the syntax right, you want to "experiencing the results" to know whether it does the right thing. For example, whether whatever assumptions or mental model you had when writing the rule play well with the rest of the environment.

Alex McLean 2023-09-22 14:13:23

@William Taysom That seems to suggest a hylomorphic way of working where you know what the results should be before you make it. I'd say that's generally not how people make things, i.e. that experiencing the results is more about understanding what you wrote for the first time, rather than seeing whether you got what you originally wanted.

William Taysom 2023-09-22 14:39:26

More I was thinking of the system working with you to disambiguate, refine, so you don’t exactly know what you want in advance but when presented with options with differences clearly indicated, you might be better at refining your idea.

Jason Morris 2023-09-22 18:23:07

I opted for Blockly's structured editor instead of controlled natural language in text for exactly this reason. Easy to read and easy to write are orthagonal. I think a lot of controlled natural languages actually end up as a worse user experience as a result of the false expectation they set up that writing it will be easy, and how violently that high expectation is violated. A regular code language at least looks hard to write, so when it is you don't feel like you've been lied to.

Alex McLean 2023-09-23 19:28:59

(It turns out they're going to solve this with autocomplete-style features)

Tim Lavoie 2023-09-23 00:35:58

I had a couple thoughts bouncing around, listening to, 66 • A Small Matter of Programming by Bonnie Nardi.

  • Jimmy mentioned writing browser extensions. Just recently, there was a thread (probably on HN), with discussion of people sharing filter snippets for uBlock Origin. It turns out that besides simply filtering links and so on, the snippets are also being used to modify styles and visibility for all sorts of things that people find needing change on various web sites. This, along with the whole "view source" era discussion, suggests that it hasn't gone away. Browser extensions such as uBlock Origin also include a colour-style picker for identifying the elements on the page that you're interested in. So in a way, it is very much enabling a simple sort of end-user programming, right in the browser. You won't see the back-end, but can manipulate the DOM that is very much on the client.
  • Regarding the discussion in the episode on early education, teaching kids programming, I was thinking along the lines of teaching the means to observe. "View source" is one such part, along with browser dev-tools. Perhaps most people won't be interested in modifying the programs they use, but teaching the idea that introspection, via software-as-microscope, is possible. Too much of our computing is directed to being strictly consumption, that I suspect few people will even think of being able to look at the innards. Think Wireshark for networks, source-level debuggers where you have source, or binary analysis tools where you don't. (Probably related, I got a Snapshot cartridge for the C64 as a youth, and was amazed at being able to capture the entire state of a program, fiddle with it, and save it as an executable to resume.)
Ivan Reese 2023-09-23 00:40:46

Ah, lovely thoughts. Thank you. I like the idea of "software-as-microscope", if I take your meaning correctly. ResEdit, or dtrace, for instance. Does anyone know good examples that are designed for nontechnical people?

Tom Lieber 2023-09-23 01:31:56

The screen magnifier (literally), in particular when it doubles as a color picker.

Tom Lieber 2023-09-23 01:33:03

Task Manager

Tim Lavoie 2023-09-23 06:00:13

Huh, there's even Dtrace for Windows.

The Snapshot cartridge struck me as miraculous. One physical button on the top, pushing that dropped you into a menu, with options such as a monitor to inspect the current state of the system. For a know-nothing kid, it was an eye-opener.

rr.c64.org/wiki/Super_Snapshot

For web stuff, tools such as OWASP ZAP or Burp Suite may not tell you what server-side code does, but you can learn to infer quite a lot. Inspect the requests/responses, interrupt and fiddle or replay them, and so on.

I don't know about non-technical resources, but anything that integrated with a scripting environment would be more accessible to the layperson than most. ARexx for the Amiga for instance, to script and connect applications that support it. (en.wikipedia.org/wiki/ARexx) Or image-based environments that include documentation, and the ability to inspect the innards. Lisp environments perhaps, or SmallTalk.

Erik Stel 2023-09-23 08:16:11

Brings back fond memory's Tim. I owned a The Final Cartridge III. Learned so much by poking around a live system. Maybe that is indeed what makes Smalltalk (for me) such a great environment. Your suggestions inspire/evoke some thoughts if this can be broadened to not only the environment itself but a broader scope. Thx! 🙂

Erik Stel 2023-09-23 08:27:08

And of course SoftICE later on the PC with DOS and early Windows versions.

But this is really low level shizzle. Maybe not great for teaching. On the other hand...I liked it, why wouldn't other kids nowadays like it. Small poll: add a thumbs up if you also liked the low level debugging/hacking!

Konrad Hinsen 2023-09-23 14:11:37

Wondering about browsers and extensions: is there a tutorial somewhere on "hacking the DOM", explaining how to do simple but useful hacks with the browser's built-in development tools?

Tim Lavoie 2023-09-23 17:26:24

In terms of security-type hacking, Portswigger has an excellent set of instruction / labs online, for free: portswigger.net/web-security

It's focused on Burp Suite, but there is a free version. ZAP has some YouTube tutorials as well.

📝 Web Security Academy: Free Online Training from PortSwigger

The Web Security Academy is a free online training center for web application security, brought to you by PortSwigger. Create an account to get started.

Tim Lavoie 2023-09-23 17:29:59

@Erik Stel Do you do much Smalltalk these days? I've only ever tinkered, though did just re-download it again.

Tim Lavoie 2023-09-23 17:45:59

Also very timely to the discussion, from Carson Gross: htmx.org/essays/right-click-view-source

Tim Lavoie 2023-09-23 17:58:00

And another great link, from a friend in our regular chat: drive.google.com/file/d/1Qu_dnc1ylSuUOxyiRbhjUeIgP23gcBMG/view

"Programmers should

no more be asked to

work without access

to source code than

auto mechanics

should be asked to

work without looking

at the engine."

Talks about how different environments deal with access to source code.

Erik Stel 2023-09-24 12:40:48

@Tim Lavoie I develop in Smalltalk most of the time. I have my own company (with a like minded business partner) and can decide for myself.

Some (potential) customers do find it difficult though, since they see it as a continuity risk for using "impopulair technology" 😉. To be fair, I do understand this feeling and it is something to weigh in when getting into the boat with us.

Tim Lavoie 2023-09-24 15:30:07

@Erik Stel I like that expression ("getting into the boat with us"), very descriptive.

Peter Saxton 2023-09-24 20:45:40

This was an interesting video. Not sure what the state of the project is, but it got me thinking along similar lines. youtube.com/watch?v=NxsaHxON350