[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: desktop.png (6 KB, 1024x768)
6 KB PNG
I'm building neo, a programming language, a live OS, and a game engine that all share the same object graph.

The object model comes from Self. There are no classes. Objects send messages to each other, and you make new objects by prototyping from existing ones. The goal is to inspect a running object, change how it responds to a message, and try it again in place. The VM can JIT-compile the code while you're doing this.

The part I wanted to add to Self's model comes from Lisp: give programs a representation that other programs can read, build, and rewrite. In neo, that representation is the object graph. A method lives in the graph alongside the objects it works with. The editor can inspect it as data, a tool can transform it, and the evaluator can execute it.

There's also a pure functional part called Knight. A game object might receive a message to move, pass its position and velocity to a Knight function, then decide what to do with the returned position. The object owns the state. The function does the math.

The desktop and apps live in the same image. The game engine is a set of packages for geometry, rendering, and simulation. The workflow I want is to run a game next to the editor, pick an object in the scene, change its behavior, and keep playing. The same tools should let you do that to the desktop itself.

Right now the image boots to a basic desktop in the hosted VM and through an x86-64 UEFI pre-OS. The full engine and live editing workflow are still in progress. The DE is a work in progress.
The idea here is that every time you ship a program with neo, you ship a mini OS with it, used for debugging purposes.
>>
Sounds like a huge security risk with no use case
>>
>>110273455
The use case I care about is live game development. Say an enemy gets stuck halfway through a level. I want to pause it, inspect the exact instance that got stuck, patch its behavior, and resume from that state. You can already do versions of this with debuggers and hot reload. The experiment is whether making that workflow part of the object model makes it easier to use consistently.

The security objection is fair. If any package can rewrite any object it can see, one bad package can compromise the whole image. I want the editor to be able to change objects I’ve explicitly given it access to, and ordinary app code to have a much narrower scope. That permission model is still a design goal. The current prototype is a development environment for trusted code.
>>
Same object, two representations. This is the intended syntax.

>canonical object graph
(object counter
(position 0)

(on advance (speed elapsed)
(set position (+ position (distance speed elapsed))))

(distance :knight
(fn (speed elapsed) (* speed elapsed))))


>high-level Neo and Knight
object counter {
position = 0

on advance(speed, elapsed) {
position = position + distance(speed, elapsed)
}

knight distance(speed, elapsed) = speed * elapsed
}


Both boxes define the same object, slot, message handler, and pure function. Neo handles the state change. Knight does the calculation.

The idea I borrowed from Lisp is that ordinary programs can inspect and rewrite code. The object graph gives tools that representation. The high-level view makes the same program easier to scan: the message handler reads like an action, and the calculation reads like a formula. Editing either view changes the same underlying graph.
>>
>>110273465
>what's the use case?

Say you're building a synth and it's already playing a loop. You hear something wrong with the filter. In neo, the idea is to inspect that exact synth instance, change the filter, and hear the difference on the next audio block. The sequencer keeps its place. Notes that are already playing keep their envelopes. You can A/B the change while the loop is still going.

The synth is an object that owns the voices and handles messages like note-on and note-off. The filter math can live in a pure Knight function. You can rewrite the calculation while the synth keeps the state it needs to keep playing.

You can do versions of this with hot reload today. What I'm trying to find out is whether the same workflow can work across a whole system. A synth, a game object, and the desktop itself all live in the same object world and can be inspected with the same tools.

>does that mean any app can rewrite the synth?

Only if you give it that authority. A meter might get a reference that can read levels. A sequencer gets one that can send notes. The editor gets one that can replace the filter. That's the security model I'm aiming for. The synth is an example of the intended workflow, not a demo I have running yet.
>>
>No Sneed. No Feed. No Seed. Just pure Chuck, all sharing the same Fuck and Suck.
>>
>>110273445
Making great progress saar
>>
>>110273445
u s e c a s e?
s
e

c
a
s
e
?
>>
>>110273465
>>110273528
>>110273547
Okay but why is it an operating system?
>>
>>110273592
Fast live programming and prototyping, a system with clean boundaries between objects and functions, objects that you can prototype (in real-time) with functions, proper objects that communicate with messages with metaprogramming built into the structure it self via the object graph.
>>
>>110273607
Because languages become more useful when they evolve into OSes and game engines, just like how a language is useless without I/O libs, or frameworks.

Same idea but you take this several steps over.
Smalltalk already does this.

If you're writing basic programs, you may not see the benefit.
But imagine writing Unreal, Blender or a video editor with Smalltalk instead, as one coherent suite, plus the live editing it gives you.
>>
>>110273634
>become more useful
Then how come languages like that aren't used for anything useful?
>imagine writing
Okay but why does that require the entire game engine and development suite to be an operating system?
>>
>>110273445
AFAIK smalltalk/self already has full self-modifying capability through live object updates and the way message passing works (i.e. fully dynamic), so I don't see how what you're describing is changing anything.
Also I have recently received an epiphany that macros are in fact the most powerful part of lisp. Literally the bell curve meme, because until now I though it was more about the image-based development model and things like conditions/restart which empower it. In fact, macros enable image based development across time and space (e.g. very easy time travel, incremental compilation optimization, cross-platform, over a network).
Macros, however, are enabled by the language having a "single unifying principle" (lists in this case, which aren't great but do the trick). So macros are programs that process lists, and code is also programs that process lists, and code IS lists.

My point: in smalltalk/self, that unifying principle is objects in the smalltalk sense. If you will use this as your basis, you should comprehend this and work from that level. Otherwise you can choose other abstractions: lua and python use associative arrays. Machine code uses bytes. Forth uses the stack.

Other than that, end to end integrations like these are the future (and the past, e.g. oberon and lispos). So long as you don't vibeslop as much as your OP suggests you do, it would be fun to see where you go with this.
>>
>>110273607
Think of emacs as "an OS", or the browser as "an OS", and I think it would make things a lot easier to understand.
>>
>>110273634
>as one coherent suite
So, the language becoming dependent on its environment, kind of like TempleOS with HolyC and its graphics/document routines?
>plus the live editing it gives you
A lot of modern languages support live editing, what makes Smalltalk better suited to this as opposed to Zig?
>>
>>110273866
>A lot of modern languages support live editing
Aside from smalltalk, lisp and forth, that simply is not true. For example zig absolutely does not do that, but perhaps most notably, even jsfags are stuck having to run a watcher and pushing code bundles to update the program, which replaces state on reload instead of keeping it like proper live editing does.
>>
>>110273838
Sure but nobody is loading up emacs or browsers with UEFI and letting it control the entire machine. It is completely unnecessary.
>>
>>110273877
>zig absolutely does not do that
sorry I was thinking of Roc, my mistake
>>
>>110273889
ChromeOS effectively does that (with browser). There are people who did port emacs to bare metal iirc. In the broader sense, collapse os and lisp os and movitz come to mind. There are also a few bare metal ocaml OSs. All of these basically just run a shell for the programming language on bare metal that control the whole system.
>>
>>110273903
Buy an ad
>>
>>110273932
y-you too
>>
>>110273889
The whole point is that it's a live OS, that can also work as a portable app on your host OS, like Windows or Linux. emacs is a poor comparison, think more like Smalltalk rather than emacs.
>>
>>110273445
didn't ask
>>
>>110273983
>The whole point is that it's a live OS
Isn't every OS a "live" OS? isn't that the "Operating" part of Operating System?
>>
>>110273992
You are running windows 11 right now, but imagine that you had the source to it. Could you edit explorer.exe, recompile it, and reload it, while retaining your exact state and just applying the change?
>>
>>110273927
>>110273983
Alright but more to the point of this thread what is the point of doing all that simply for a shitty game engine that no one will use or play? No offence but Lisp OSes and so on are actually fully featured systems, this is a toy with a feature that is not only unnecessary but guarantees nobody will want to touch it.
>>
>>110273992
Live, as in you can inspect the assembly, sure. but not live as in you can inspect human read-able code.
>>
>>110274007
I didn't know that was the definition of "live" I've never seen that definition used anywhere before
>>
>>110274006
I mean why start anything? what's your argument here?
I made this mainly or initially to understand Smalltalk/Self and even Haskell better.
And also, I've noticed that Smalltalk, Self and Lisp need a lot of modern clean up. So I figured I'd create a neat hybrid that makes sense, or attempts to make sense of them all in one coherent system.
>>
>>110274017
Got a better word or term?
>>110274029
Makes sense here doe
>>
>>110274029
"makes sense" here doesn't mean mix them up randomly, but to take something from each and try to build a coherent system with.

Smalltalk and Self needed a structure that gave them better metaprogramming, Lisp already solved this problem. So use a Lisp adjacent graph for the "assembly" of the language, and build higher-level code that lives on top. This also solves the readability problem of Lisp.
And so on, there are many interesting problems to solve with these systems.
>>
>>110274029
Sorry but I got the impression you really believed this was a project worth completing and not just hobby homework code. It's commendable that you're doing some novel for fun but it seems like you're putting the cart before the horse by trying to write "a programming language, a live OS, and a game engine" if you don't even understand how it is implemented in other classic languages. No offence I'm just trying to understand what you're really trying to do here since all you have shown is a blank "desktop".
>>
>>110274037
Inspectable? idk using "live" when it already has an established meaning just seems odd and incorrect
>>
>>110274057
Yeah, the desktop is not complete. I should've been a bit more patient.

But I think, it's not just homework (I mean for me it is) I really do believe that a coherent cleanup for Smalltalk and Self is needed. Technically that would be JS with the browser (notice the vague similarities here, where OS and language meet, except the browser is a mess)

I've added or have attempted to add the "object graph", basically I renamed what Lisp already solved and now I'm adding it to my Smalltalk hybrid. Smalltalk had reflection, but it needed a better structure for that, and that's where Lisp fills in the blanks so to speak. I think that's cool and useful.
>>
>>110274006
Everything has to start somewhere. Things will be refined as he works on the full stack in concert.
This isn't a full os or whatever but here's what doing just an engine, a game, and a language at the same time can do for you:
https://all-things-andy-gavin.com/2011/03/12/making-crash-bandicoot-gool-part-9/
https://www.youtube.com/watch?v=72y2EC5fkcE
>>
>>110274000
>Could you edit explorer.exe, recompile it, and reload it, while retaining your exact state and just applying the change?
I could, yes. The OS doesn't ship with a default environment like that, but it's not too difficult to set it up. Maybe a little unorthodox.
>>
>>110273445
Thanks Claude very cool.
>>
>>110274096
No, you couldn't even remotely do that. Firstly, windows itself would forbid it because you're not allowed to save to files that are opened. Even if you ignore that, there is no hot reload mechanism in windows, you would have to write a way to freeze everything, patch the code in memory, then rewrite all references. But that's not enough because you have to also patch the memory state in explorer.exe before into the new explorer.exe.

You aren't reading the assignment instructions at all and instead have tried substituting it with your own ass-backward ideas. I am discussing space travel and you're talking about banging rocks together.
>>
>>110274103
My idea nigga, jeez. Sorry for correcting my grammar with it...
>>
>>110274108
>No, you couldn't
I mean, I have, so...
>you're not allowed
...
>there is no hot reload mechanism in windows
>you would have to write a way
Now you're getting it
>>
>>110274088
>>110274089
Don't get me wrong, I'm not trying to discourage you, I'm just being critical. The idea is cool and very ambitious, but in this day and age i can't help but be sceptical of projects like this that get posted when there is nothing to see. Good luck and I hope you get it working
>>
>>110274126
You haven't. Again, you're talking about banging rocks together. I'm talking about space travel. Lispos gives you space travel. You don't understand the concept even though it's spelled out for you. Can't expect any more from a windows user though.
>>
>>110274136
>You haven't.
Ok, I mean you can sit here all day and tell me I haven't done something that I've done, so have fun with that, I guess.
>>
>>110274146
It's obvious, since you don't even begin to comprehend what is being discussed. "Have you written a web server before?" "yes I wrote a hello world once and it only segfaulted half the time!"
>>
>>110274126
You can technically 3D model with a keyboard and a CLI alone, doesn't mean it's a good idea, or that a better system can't be built for that.
>>
>>110273445
have you not looked into Arcan brotherman



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.