d-cook / SomethingNew

Collaboration for reinventing software in human terms
167 stars 10 forks source link

Replace Compilers with Code #11

Open d-cook opened 6 years ago

d-cook commented 6 years ago

Think of uncompiled source code (written in a compiled-language) as a program that makes an executable program, and the compiler as the interpreter of that program. When viewed in this way, declarations within code (classes, functions, variables) act as imperative commands to create components of a program. Replacing these "commands" with an API & user-defined functions would allow programs to be generated with any components & mechanisms, rather than from a fixed set of "language features". No more language restrictions!

Example: class Foo { Bar b } becomes myClass = MakeClass("Foo"); myClass.AddMember("b", myBarClass)

Example: myTrait = new MyVeryOwnTraitsImplementation("ResizableThing"); myTrait.ApplyTo(myClass)?

See my Original Post on this topic (with longer explanation) at Cemetech

asmodehn commented 5 years ago

Compilation is just a translation from some language into "machine only" language. The less translation there is between the origin language until the final "execution"/"application"/"understanding", the simpler it is to understand the language by interracting with it, just like human learn in the real world.

Until we are able to build a machine that understand the same language as a human, we will need to find a middleground. So we ll need a virtual machine that directly translate some understandable, very powerful, yet minimal language (some bytecode) to machine behaviour.

Designing a bytecode for human readability is a real challenge however. Even python (portable bytecode, runtime compilation that make it seem like an interpreteur) didnt achieve it...

Basing it on functional languages approach seem like a viable option (what Haskell did with systemF for example, or something akin to unlambda or J or iota, that can be expended to scheme on the fly when "viewing" or "editing"...)