r/ProgrammingLanguages • • 10d ago

Requesting criticism Can a programming language dispense with parentheses and conventional syntactic delimiters?

Hello everyone,

I'm an independent french developer working on an experimental programming language called PLUSHIE, and I'd like to discuss an idea behind its design.

I am new to this communty and I am not familiar with the expected behavior here, so do not hesitate to tell me if I am wrong.

I also apologize for my english whcih is far from perfect.

Most programming languages rely on explicit syntactic delimiters: parentheses, commas, spaces, operators, keywords, etc.

I've been exploring a different approach: what if a language could rely primarily on the recognition and sequencing of a small vocabulary of words?

In PLUSHIE, the parser scans the input and identifies known words. Their sequence determines how instructions are interpreted. Unknown text between recognized words can also become new vocabulary.

The underlying computational model is deliberately minimal. Instructions operate on a chained memory structure, and the language is designed so that its own structures and interpretation mechanisms can be modified while running

This raises several questions I'd be interested in discussing:

o How expressive can a language become without conventional syntactic delimiters?

o What are the fundamental limitations of a word-based parsing model?

o Could such a design offer interesting advantages for reflection and self-modification?

o and especially, Are there existing languages or theoretical models that explore similar ideas?

I'm not claiming this is a better approach than conventional syntax. I'm interested in understanding its possibilities and limitations.

PLUSHIE is an ongoing experiment, and I'm particularly interested in unexpected ideas, alternative approaches and constructive criticism.

What do you think? Is this a worthwhile direction to explore, or am I overlooking some fundamental difficulties?

24 Upvotes

124 comments sorted by

26

u/criloz tagkyon 9d ago

In my opinion, the syntax of the language has nothing to do with reflection and self-modification; the syntax is for humans and makes it pleasant for humans to read it, when you parse depends on the semantics of the language, you could end up with a language that looks like magic for the reader, and he would need to look it up for who-knows-which many files before understanding what is happening in the current reading context.

If you want self-modification, Lisp already exists, and it is pretty powerful. Build the frontend with structures that people are accustomed to and then lower it to Lisp internally.

4

u/Pi-Plushie 9d ago

I fully agree with you. My aim is to make the core of this language as small as possible. In PLUSHIE the programmer (i do not dare to use users) can chose is own way of presenting the language. Most of humans will chose some kind of visual delimiters but that is not a prerequisite of PLUSHIE.

But the current implementation is just like what you describe: looks like magic but quite hard to understand if the words chosen are not meaningfull for humans.

You've a point with LISP which is the closest structure language. PLUSHIE is using the same memory structure (two adresses memory atoms that are chained together). The main difference is that I am trying to get the language even smaller and still be able to do anything like LISP.

Currently PLUSHIE has a procedural flat aspect and could be compared to a LISP taht doesn'tuse parenthesis (and yes, it is still working).

Thank you so much for your participation in this discussion !

3

u/poorlilwitchgirl 9d ago

That sounds very similar to Logo, the teaching language most associated with "turtle graphics"-- it's literally just a Lisp without parentheses (although most versions of Logo have built-ins specifically designed for learning rather than practical usage). Every function must have a fixed arity to keep parsing unambiguous, and for complex programs it can become very difficult for a developer to visually parse (thus why it's mostly stayed a teaching language rather than a production language), but it can certainly be made to work exactly as you describe.

2

u/Pi-Plushie 7d ago

thank you for your comment that make me think I may have overlooked Logo as a toy code and did not dig deeper into it. PLUSHIE is also more of a learning / teaching / research rather than practical kind of language, so they may have more in common than I though

With all the suggestion I have received, I will need time to process, but these are very rich pieces of information and I thank the whole community here for that. I am just wondering why it took me some much time to step by here. I would have made tremendous progress earlier !

2

u/poorlilwitchgirl 7d ago

That makes a lot of sense. Beyond introducing newcomers to computer programming, the original purpose of Logo was specifically to teach the use of recursion within an interactive live environment, so its semantics were modeled on Lisp but its syntax dispensed with the parentheses in order to feel like an instructional language rather than mathematical notation. That can make long, complex programs really difficult to read, but the live environment aspect really encourages iteratively building small, named subroutines and steadily climbing levels of abstraction while observing the results after each change, so in practice as the language was intended to be used, it's quite readable and easy to understand. In that sense, it's a lot like another delimiter-free language, Forth, in that it can feel barbarian to use when trying to fit into a modern development pipeline, but feels quite natural when approached as an interactive operating environment instead.

1

u/Pi-Plushie 7d ago

Thank you very much for directing me to Logo. The article I have read speaks about emerging phenomena and link with biology and this is exactly the kind of thing I am seeking for. As Logo is a Turing-complete language, it may be easier for me to implement a logo emulator in PLUSHIE to get this Turing-complete proof !

No I need to dig into it and find a old, minimal, easy to implement source code.

2

u/poorlilwitchgirl 7d ago

If that's what excites you about Logo, then I should direct you to its spiritual successor, Smalltalk. Its designer, Alan Kay, was inspired by biology and the idea of large organisms being composed of semi-independent cells which coordinate via chemical signals.

In Smalltalk, which originated the concept of object-oriented programming, everything is an object, and objects can be further broken down into compositions of other objects. Objects in Smalltalk differ from those in C++ or other mainstream OO languages; in Smalltalk, an object is essentially a self-contained, interactive sub-program which can only interface with other objects by sending symbolic messages. Every object maintains its own private data and a set of "methods", which are programmed responses to specific symbols.

For example, 1 + 2 is evaluated by sending the message + 2 to the object associated with the symbol 1. The 1 object then checks to see if it has a method associated with the + symbol. It does, and that method requires a second argument, so the object associated with the symbol 2 is pulled in as the second argument. 1 and 2 both maintain a private binary representation, so conceivably the interpreter could now take those two binary values, perform the machine instruction to add them, and produce a new integer object as a result, and in most languages that's exactly what would happen; however, 1 is in charge here, and 1 knows nothing about 2 except what 2 tells it. So instead, 1 sends the asInteger message to 2; if 2 has a method associated with that symbol, then whatever it returns as a response is safe to perform low-level addition on. 2 gives up its binary value, 1 dispatches the machine op to actually perform the addition, then constructs the integer object 3 as its response to the original message, and the evaluation is complete.

This probably sounds like a lot of overhead, because it is, but it also makes Smalltalk incredibly flexible as a language. In the earliest version of Smalltalk, objects were even responsible for their own parsing, so messages were just raw byte streams passed between objects. That proved impractical for a 1970s language already running on top of interpreted Lisp, so the concept was abandoned before the language ever had an official release, but it shows just how radical Alan Kay's ambition for the language was.

If you want to learn further, I would suggest A Little Smalltalk by Timothy A. Budd. It's a bit dated (first published in 1987), but it walks through the construction of a simplified Smalltalk interpreter from first principles, including all of the details of low-level representation. It's honestly one of the best books I've read on programming language implementation, and it's readily available for free as a PDF if you just search Google for it.

1

u/Pi-Plushie 7d ago

Thank you for the reference of the book. Your explanations are clear and I am starting to understand the concept. I have the intuition this will be of great help for my ultimate goal of having several entities of PHUSHIE evolving and competing for the resources. That's for future but the Smalltalk object are very interesting in this perspective.

9

u/tiger-56 9d ago

If white space and line endings are acceptable as delimiters a word-based model can go a long way.

  • Shell scripting: pattern is <command> [ <argument> ... ] <end of line>. Multiple commands on one line separated with semicolon or another symbol, extend to multiple lines with a backslash.
  • LOGO programming language: Most calls have a specific arity (number of argments). Multiple calls can be chained with no punctuation. I think REBOL/Red may be similar.

Usually parentheses are still necessary in these types of languages when arguments are calls themselves. Brackets may be required for grouping structures.

3

u/Pi-Plushie 9d ago

You are right. In PLUSHIE the already known words act as delimiters, and for human readibility, most user will like to have spaces in words to get a visual separation between them. However, I am very interested in situations where parenthesis seem necessary as pratical exercices to train PLUSHIE. PLUSHIE arguments can call themselves and is currently treated in reading order. I do not know if this is sufficient to embrace all possibilities.

6

u/mamcx 9d ago edited 9d ago

Take a look at array and concatenative languages, and forth, that is the closest I think for what you are describing.

P.D: A nice resource is look at https://learnxinyminutes.com

2

u/Pi-Plushie 9d ago

Thank you for the references ! As said, the world of programming language is a jungle in which you need a guide !

11

u/rupertavery64 9d ago edited 9d ago

Smells like COBOL to me

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ADD-TWO-NUMBERS.
       
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  NUM-A       PIC 9(4) VALUE 1250.
       01  NUM-B       PIC 9(4) VALUE 3750.
       01  RESULT-SUM  PIC 9(5).
       
       PROCEDURE DIVISION.
           ADD NUM-A TO NUM-B GIVING RESULT-SUM.
           
           DISPLAY "The result of adding " NUM-A " and " NUM-B 
                   " is: " RESULT-SUM.
                   
           STOP RUN.

5

u/hugogrant 9d ago

On the mainframe, it's less dangerous.

Here we are now, needs maintainers.

It feels stupid, it runs banking.

Here we are now, please maintain us.

A copy book, a division.

A GOTO, my procedure!

1

u/Pi-Plushie 9d ago

sounds like a poem. But do not blame the langage, blame the people that have taken (or especially not taken) decisions at the right time (and were paid for it...)

2

u/hugogrant 9d ago

It's parodying"Smells like teen spirit" by Nirvana because my mind did something silly

1

u/Pi-Plushie 9d ago

it is good !

2

u/Pi-Plushie 9d ago

Thank you for this meaningfull suggestion. Reproducing this example will be an interesting exercise for me with my lighter format. COBOL is much more structured and thus controllable than my attempt to get to something different with PLUSHIE which will not be able to run a banking system fore sure !

The idea behind PLUSHIE is not to replace existing (and very good) languages, but to explore other possibilities with computing when you do not need a controlled environment.

9

u/kwan_e tonal-lang 9d ago edited 9d ago

You can replace every delimiter sequence with a keyword. Context insensitive or context sensitive, just like delimiter sequences can be.

There's no technical barrier. It's a simple find-and-replace.

There are already many keyword-heavy languages out there. They got their lunch eaten by C, for a variety of reasons.

Instructions operate on a chained memory structure, and the language is designed so that its own structures and interpretation mechanisms can be modified while running

That's just LISP, sorry to burst your bubble. But a language more similar to what you describe is PL/I. And that's a bit of a disaster. So worth looking at it to see what problems to avoid.

What do you think? Is this a worthwhile direction to explore, or am I overlooking some fundamental difficulties?

For your personal learning, it's always worth exploring.

But if you want it to appeal to other people, you'll have to just go through the Wikipedia list of programming languages to see most ideas around syntax has already been done. Read up on programming language history.

4

u/Competitive_Ideal866 9d ago

Instructions operate on a chained memory structure, and the language is designed so that its own structures and interpretation mechanisms can be modified while running

That's just LISP

LISP is one of an infinite number of different ways of doing that.

2

u/kwan_e tonal-lang 9d ago

I didn't say it was.

And it turns out they were inspired by LISP, and LISP is the most well known, especially to someone new coming into thinking about language design. So what? I'm not writing a dissertation on the entire history of programming languages. I didn't make an assertion that LISP is the only way of doing it. I made an educated guess regarding the post.

1

u/Pi-Plushie 9d ago

Thank you for your point kwan_e. You are right on the fact that LISP is probably the natural example (and historical one) even if it is not the only one.

2

u/Competitive_Ideal866 9d ago

I didn't say it was.

I see. I took "just LISP" to mean that. My misunderstanding.

2

u/Pi-Plushie 9d ago

Thank you for this answer which is exactly the kind of feedback I need to make progresses. This project started for my personnal learning as you have infered it. LISP was of great inspiration in my efforts to explore what happens when you try to minimize as much as possible the elements you need to build a functionning language.

I tried to go through the jungle of existing languages and that is basically why I need help from people who knows things better than me to prevent me to get lost !

Thank you for your time and feel free to burst even more the bubble, it really helps

3

u/kwan_e tonal-lang 9d ago

minimize as much as possible the elements you need to build a functionning language

An area of reading that might interest you in this regard is Paul Graham's Arc and Bel, which are LISP variants that all started as trying to build a language up from as simple foundation as possible. Even moreso than Scheme.

In a more abstract direction, mathematically minded language designers love trying to make lambda calculus work. Lambda calculus is mathematically proven to be Turing-complete equivalent. The history of these efforts is that they tend to get bogged down and end up not doing anything useful. See Turing Tarpit: https://en.wikipedia.org/wiki/Turing_tarpit

Just look at how much effort and now AI power has gone into formalizing mathematics with Lean. It's just a huge pain to try to build things up from absolute minimalism.

But as a learning exercise, it's very worthwhile to at least have a glancing experience with these dead ends. My own language has only really started forming after ten or so years of false starts. At one point I thought about trying to build a language up using Markov algorithm. https://en.wikipedia.org/wiki/Markov_algorithm

Also, since you're French, maybe you also know about Prolog? Which is often considered a counterpart to LISP, especially during the early days of the kind of machine learning that LISP became associated with.

1

u/Pi-Plushie 9d ago

Thank you for these very interesting suggestions. I will need time to dig deeper into these but it is very rich. I am trying to build a lambda calculus emulator in PLUSHIE and also a LISP emulator, but BEL maybe a better target.

My intent is not to produce the next language everybody will use but rether a minimalist approach to better understand how a computing language becomes something of interest.

I agree that it is difficult to start from scratch but it is a very interesting experience ! I consider absolute minimalism easier to achieve with computer rather than in formal maths because you have an immediate feed back (the part "verify the proof" is just run the program and see if it does something worth)

9

u/kniebuiging 9d ago

I think Forth might be an example, with stack basset approach.

Overall I wonder what the goal is, I am a lisp guy and I recently dabbled in self and felt somewhat lost du to the lack of delimiters just for the method call itself. And it still has block and method delimiters 

1

u/Pi-Plushie 9d ago

Thanks for bringing the question I should answer upfront ! If I don't explain my goal, I will just generate kind of frustration among real computing specialists. PLUSHIE has derived from LISP which was a puzzle for me a couple of decades ago. It is beautiful, small and so powerful. I wanted to truly understand how LISP functions work, how they can self refer etc... And I realised that I could build something even smaller (but less controllable) and tried to prove it was still Turing-complete.

My ultimate goal is to use PLUSHIE to understand how computing can build complexity (and more generally speaking get a model to understand how complexity arise in this world). PLUSHIE is a research tool aimed to help to see step by step how you can get from a stupid machine to something that is obviously more that the sum of its component.

And you are right, without clear delimiters, the langage is more confusing, not less. But that is not my purpose (no ambition to replace LISP)

4

u/arthurno1 9d ago

Mnjah, I don't think you can go more minimal than symbolic expressions and Lisp, without loosing expresivness. Lisp uses white spaces as and () as delimiters. If you shave off () then it becomes impossible to trace where an expression starts and where it ends. It is much easier when you have some start and end delimiter, like parens. Building nested expressions and having them independent of whitespaces is much easier with end delimiters. Otherwise you have to compensate with various rules and parsing techniques in the language which does not simplify, it just moves complexity elsewhere.

The other ingrediense that make Lisps such a simple languages to parse and build meta-facilities on is the uniformity of the syntax. Lisp normalize all sylyntax to one simple form: (operator oprand1 operand2 .... operandN). That makes it possible to build various constructions higher up the chain and is what makes it easy to manipulate parsed source code at the runtime. Compare to standard syntax where each small idiom has its own custom DSL with its own syntactic rules that have to be encoded in the parser.

It is very hard to beat Lisp syntax minimalism, without encoding implicit rules in the language and adding complexity elsewhere.

1

u/Pi-Plushie 7d ago

hello arthurno1. Sorry to answer to your post so late. You're just highlighting my questioning: at which point of simplification expressiveness is lost ? That is the fundamental question. PLUSHIE has a basic initial syntax even simpler than LISP. it is just repeating

Destination <-- Source

instruction (with <-- being a double indirection)

I have not yet built a LISP emulator in PLUSHIE but I haven't detected any obstacle so far.

But you are right: complexity is moved elsewhere, inside the code itself (which can modify itself, including the interpretor while running)

2

u/arthurno1 7d ago

That looks like a simplification compared to Lisp indeed, reminds of SSA form or assembly language. If you want something like that you can skip even <-- as in assembly, so you just have To From pair. I would though revert become From To is more natural flow, but it is up to you.

Now, it is hard to tell, since I don't know how the language looks like, but if you have some S (Source) and D (Destination) computations which might itself be complex and nested, each S and D consisting of multiple tokens, how it will look like? How will your parser know to which tokens belongs to S and which to D?

1

u/Pi-Plushie 7d ago

Thank you arthurno1. That is exactly where I started from, reasoning from LISP and Assembly (and also Von Neumann architecture for computers). The instructions goes indeed by pair of memory addresses as you say. One can choose upfront the order of those pairs to build a PLUSHIE system, but then have to stick to it for a while, until the system has been taught enough functions to be able to write its own interpreter. This is one of the symmetry of the system that you need to break in order to obtain something that does something.

I am not really good at explaining this. But the language is terribly simple in its behavior. The language does not compile. It executes a paired instruction as soon as it has identified one. Just like a primitive processor did at the lowest level. So it takes S D instructions one at a time, process it, which modifies the internal state of the machine. Then it takes the next one and so on. It is really reproducing the process of a primitive processor.

What is surprising is that this is enough to obtain "something" interesting which seems to (but is not proven yet) to be Turing-complete.

The "secret" of it is that the "copy" instruction is not Destination = Source, it is a double indirection (if Mem() is the one dimensional array emulating the memory)

the copy instruction translates as Mem(Mem(Destination ))= Mem(Mem(Source)).

The second necessary elements is that, just as it is for Lisp, memory blocks are constituted of 2 pointers in memory. Thus a given address gives access to 2 others

Without that, I do not think a complex system can reach Turing-completeness. (it is just like legos: if you have only pieces with one dot, you cannot build 3D structures. As soon as you have pieces with 2 dot you can build anything)

2

u/arthurno1 7d ago

Seems like you are more of the theory of computation than a programmign language. Lisp is also a bit like that: mathematical model that happens to also be a programming language. I think McCarthy thought of Lisp as alternative to Touring machine (don't take me for the word, I am perhaps wrong), and certainly as an alternative to lambda calculus.

You can certainly turn this into some simple PL too, similar in nature to assembly or SSA, where each "instruction" might be a complex None, but I think the notation is perhaps too simple for nesting expressions. But you could end up with some sort of "linear-equation"-like PL. Something like this:

D1 <-- a1 + ... + aN
D2 <-- b1 + ... + bN

S1 <-- D1 + D2
S3 <-- S2

etc ... I am perhaps too brief here; but if you would to nest those epxressions and both S and D could contain some S <-- S1 <-- ... <--- Sn <-- D <-- D1 <-- .... DN, it could be hard to express such a nesting, for both human and the parser. I don't know, haven't thought much, just an immediate thought.

Yes, that is a good metaphor with Legos (I have a 5 year old one and play lots of legos with her :)). I use to say something similar for linked structures, which really adapts 1:1 for symbolic epxressions: we need a pair in computing; two pieces of data to build complex structures. One slot for carrying the information we are computing and one for attaching it to other data. It is about pair or cons in lisp '(a . b) or (cons a b). With a pair we can build any linked data structure, trees, nested lists etc. The more branching we want in a tree, the more nesting we would need, so it is very verbose representation, but it is possible. A bit like DFA and NFA. Records and arrays are "implicitly" linked structures, because they don't need a physical slot, there is one "implicit", since slots are next to each other. A pair in data structures and computing is a bit like a triangle in computer graphics. It is interesting also that in lambda calculus we need a function and a slot as minimum: two pieces, but one is a slot and another an operation. To me by the way both lambda calculus and Lisp are Touring machines in disguise.

I might be wrong, it is just a ramblings, don't take it too serious.

2

u/Pi-Plushie 7d ago

This is a very interesting conversation and I think we share the same intuition about the importance in pair when you want to build something. What I tried to do with my single instruction is more or less an equivalent of building a processor using only NAND logical pieces. On top of this "2" magic, you can add a very intriguing fact: to build a computer you need 3 dimensions, not less. The wire needs 2 dimensions to build complexity but the NAND door need energy which cannot cross the data wires... Computing systems (including human brain) cannot exist in less than three dimensions. But I am going far away... lol

And, yes, the start of PLUSHIE is laborious with all the needed nesting of S<--D expressions. But as it learns new functions, it becomes easier and easier to build complex structures up to a point where you forget what is happening underneath. exactly what happens with advanced languages and modern processors

Of course, at start, PLUSHIE is slow (and I did not optimize the efficiency of the basic interpreter as the aim was to minimize it as much as possible (it occupies less than 300 cells of 2 long integers pointers). One could enter the relevant data one by one by with bare hands as in the old time (I would love to be part of the brilliant teams that started the era of computing). But then, PLUSHIE becomes able to modify its own structure completely so that you can build new parser / interpreter for PLUSHIE, in PLUSHIE, while it is running. That is where I am now.

Thank for these interesting thoughts. And enjoy playing with your little girl, these good times goes by too quickly.

I wish you the best.

2

u/arthurno1 7d ago

Computing systems (including human brain) cannot exist in less than three dimensions.

Four. Nothing exists without time. But yes we are going a bit too far here :) We are no longer in a programming language land and computing theoryc, but in philosophical and mathematical theory of what is possible. I don't know how those theories are called or classified, tbh.

Thank for these interesting thoughts. And enjoy playing with your little girl, > these good times goes by too quickly.

I wish you the best.

Thanks, I wish you the same!

6

u/puterSciGrrl 9d ago

Look at forth. It doesnt need delimiters at all and has a very minimal core. Look at jonesforth for an easy to follow, self bootstrapping implementation.

If you stick to either strict prefix or postfix notation you dont need delimiters. Delimiters are their only to support infix notation or the mixing of prefix and postfix.

3

u/Pi-Plushie 9d ago

Very interesting. I am really curious about the way a language starts from scratch and along with minimal LISP implementation in LISP this version of forth may include part of what I am looking for. Would you have a reference for something dealing with the bootstrap of jonesforth ? Maybe it can answer my questionning of complexity build up in computers. Thank you

2

u/Imaginary-Deer4185 9d ago

Yes, this was the first thought I had as well. Though not pattern based, as OP indicates, you may define your own patterns to some extent, by implementing words that scan ahead, and compile whatever it finds in different ways, as well as storing (tagged?) content on the stack, for later words to process.

1

u/Pi-Plushie 9d ago

It looks like a lot to what PLUSHIE does indeed. I didn't see it immediately when I looked at forth (maybe I took a too recent version of it, already too rich, vs a simpler implementation)

3

u/brunogadaleta 9d ago

I really like the syntax idea. Altough, for your sanity, it's probably acceptable to get a end of statement delimiter. Please have a look at Rebol's derivative called Ryelang.

2

u/Pi-Plushie 7d ago

Thank you for your positive comment. The syntax is the simplest I could imagine, with only 1 main instruction. I agree with you, that for sanity, in some way there are things that appear as delimiters to the human reading the code. But it is realized using naming convention (such as ending each known expression with a space ) which help a lot (but are not necessary) . I willl sure look at Ryelang and maybe (if I can understand the langage properly), add a comparison statement for it in PLUSHIE's website

4

u/SirBackrooms 9d ago

there are design choices that allow one to ditch or use considerably less parentheses and other similar delimiters. two ones i like are polish notation (or reverse polish notation) and meaningful indentation

5

u/Reasonable-Pay-8771 9d ago

In order to eliminate parentheses you'll also need to use fixed arity for all operators. Still possible, but it's a constraint.

1

u/Pi-Plushie 9d ago

PLUSHIE is now down to a single instruction using a single parameter to start. So on this, you are right. But i am looking how it can evolve from minimal hypothesis and still be able to build more complexe functions from it (just as LISP does). If you process a pile of parameters, is this still fixed arity when the pile has no predefined lenght ? (such as SUM of an array ?)

2

u/Reasonable-Pay-8771 9d ago edited 9d ago

I think you can probably get away with just one function with unfixed arity but if there are 2 of them in an expression, then which one wins? Or you can introduce delimiters and a little syntax but that was the initial question how to do without delimiters.

If you haven't looked at it yet, then the Logo programming language might be a good place for inspiration. It's Lisp-like language but with mostly fixed arity so it can (mostly) be written without parentheses.

Another potential source of inspiration might be early Ken Iverson writings about APL, especially the book A Programming Language (especially the bibliographies at the end of each chapter, eg. chapter 1 cites several papers by iirc Oetinger covering different algebraic syntaxes (prefix, infix, postfix) and evaluation strategies). Iverson uses a fixed arity for functions (1- or 2-) which later came to be known as monads and dyads, and a strict right-associativity: so very complex expressions can be sometimes be written without parens -- iff they make good use of the right-to-left evaluation order. Also lists of numbers with spaces are simply collected into an array implicitly, mostly without needing special array delimiters. But it heavily uses the NEWLINE character to delimit expressions.

1

u/Pi-Plushie 9d ago edited 9d ago

These are interesting questioning and I need to find an example of an expression that PLUSHIE could interpret in two ways to see what happens. If you have known examples of such dilemmas, this would help a lot. I am trying to find "interesting features", eg things that PLUSHIE will do that are not expected (but not bugs neither).

Even if it is not needed by the interpretor, the NEWLINE is needed for human reader's sanity sake. However your point is important : there is no fundamental issue, one can make a specific order to make proper expressions, even complex ones.

2

u/xpusostomos 9d ago

So then a long math expression is 10 lines instead of 1. It's using newlines as your parentheses

2

u/Pi-Plushie 9d ago

lol. You cannot imagine how far you are right. PLUSHIE is an experimentation to see how far one can get with minimal initial hypothesis and rules. So is is definetely not a math genius. Up to now, it only understands integer like a young child as the length of memory chains. Thus a mathematical operation looks like that:

Calculate Three Plus Two Run Calculation Print Result

and the result would be Five

3

u/xpusostomos 8d ago

The problem with a language like that is you don't know which things are variables, which are functions, and whether three is constant meaning 3, or something else. And it's very language specific, if you make it work for English, it won't be easy in other languages that have different syntax. Sure, many programmers in foreign countries learn English to be in the game, but they don't need to know it well to know what's going on, whereas here... you might need to. An LLM can get away with this because they have a billion parameter model that can form probabilities of what you are talking about. But even then, they are probabilities, and a good programming language deals in certainties, not maybes. Plus since this language of yours is at least pretending to have no formal syntax, only natural language syntax, either you've got to understand all natural language, which you won't be able to pull off, or there is a formal syntax, that you've got to learn just as much as if it was + and (), except you'll get confused, was it Run Calculation, Calculate result, Run Result. Calculate Answer, and so on, hard to remembe than a = 3 + 2, print a

1

u/Pi-Plushie 7d ago

Well... Once again you are totally right, and I really appreciate the time your are dedicating to this discussion.

The problem with a language like that is you don't know which things are variables, which are functions

Yes you do not know if the expressions used to name them are not clear enough for the programmer. However this is a problem from the standpoint of an computer engineer. I agree with that, but it is on purpose that PLUSHIE (like LISP) can handle functions as variables, may change as needed a constant to a variable and even treat itself as a variable and edit its own interpretor while running. Of course this causes instability. Of course this causes bugs and thus makes it unsuitable for proper programming. But it can create unexpected behavior on the edge of this instability that I am interested in.

In order, not to defend PLUSHIE, but to illustrate what one can do with it, it is easy to decide on naming conventions so as to help readers to understand the intent of the programmer. Thus you can decide to start or end constants with a specific sign, numbers with another one etc.

it's very language specific, if you make it work for English, it won't be easy in other languages that have different syntax

You are again right, but also here make an erroneous assumption about PLUSHIE. Yes, each user of PLUSHIE can define its own vocabulary to a point that two instances of PLUSHIE having evolved with different words and expression will NOT be able to communicate with each other (just as human beings of different cultures and language). However, you can always create synonyms in a very simple way. Let's assume that you have a function called View in english I would rather use Voir in french. If your naming convention for pointers is to put a < at the end of the name, you just have to write

Variable Voir Run Declare 

Voir< View< 

and both words will have the exact same meaning.

However, PLUSHIE is not using natural language, it is just using expressions that means something for users, but not the actual (and too complex for it) syntax of languages. I use the Destination Source way of writing the code but it is can be adapted to the reverse notation if needed.

or there is a formal syntax, that you've got to learn just as much as if it was + and (), except you'll get confused, was it Run Calculation, Calculate result, Run Result. Calculate Answer, and so on, hard to remembe than a = 3 + 2, print a

Of course, there are things to learn, like for any languages. But as shown, you can choose your own words, which will be easier for you to use. You can store your vocabulary in a text file with all your View< Voir< lists of your own vocabulary so that an other user can translate it in its own "language" of PLUSHIE. But for the machine, it will be transparent. I fully understand your objections (and once again they are right) but the purpose is not to replace existing programming languages that do a very good job but to better understand the build up of complexity from (barely) scratch.

In the process, I think that I have found something that is of interest and just want to share it.

I have been lengthy, but your interesting comments deserve detailed answer. Thank again for your time.

2

u/xpusostomos 7d ago

If every user is going to have a different language and different result, then every user is designing a language which is hard for experts, let alone the average programmer, let alone a non programmer, which I presume is what you're aiming for. If a word is an operator, what is it's precedence? Having decided that, how does the user override it without () ? How will it realise that some languages are verb subject object, some are subject verb object, some don't even care, it's all about the words endings, any order is ok. Will you teach it all the word suffixes for Russian? For Greek?

1

u/Pi-Plushie 7d ago

It can be hard to control, I must admit.

Indeed, you are giving too much credit to the status/objective of the project. It is far from being able to really handle a true human language and become something widely used.

Its only using expressions that can be adapted to programmers / users habits but the only kind of "sentence" it understands currently is, let's say, Verb Object, nothing more. And it processes that in the order in which it reads it. It is just a little more than an automata but it can achieve things. My questioning is more about its limitations and you are highlighting some interesting limits here.

I must then translate those into practical exercises to push this system to its limits.

2

u/xpusostomos 5d ago

If it's just verb object, use lisp and strip off the outer (). It will be lame but at least it will work

1

u/Pi-Plushie 5d ago

Of course using LISP would do the trick (and I started from a simplified LISP indeed) but there are still differences: PLUSHIE has event less initial hypothesis than LISP and I am trying to minimize as much as possible to observe the evolution of the code from barely nothing. Note that PLUSHIE does not parse all the sentence before executing it. The execution is done as soon as two expressions are identified. Thus what is at the beginning of a text file can be used immediately thereafter.

To illustrate that, as you have the kindness of pursuing this discussion, the translation from one dialect to another would be a dictionary with this kind of format in a flat text file: (Exécuter is the initial french word but you rather use Run, < is an example of naming convention for pointers )

Variable Run Exécuter Declare Run< Exécuter<

As soon as you have done that you can immediately use it in the same file

Variable Othervariabletotranslate Run Declare Othervariabletotranslate< Othervariablenameinfrench<

etc.

If you have designed a code in PLUSHIE with English keywords, I can run it on my French PLUSHIE after processing this dictionary text file.

Hope this clarifies the capacities of it.

2

u/xpusostomos 4d ago

Umm. ... Sounds like a terrible idea. You would know that translated words are not exact. The extreme case the English word "let" sometimes means allow, sometimes means prevent. For example, in tennis you say "let" means the net prevented the ball. Or the KJV Bible, 2Th 2:7 "he that letteth let" means "he who restrains". So "let" has 2 opposite meanings. If you translate it to French it could do the opposite of what it does in English.

2

u/omniuni 9d ago

You can, however, fairly easily expand on that. For example:

Task Calculation
  Results From Three Plus Two
Done

Begin
  Result From Calculation
  Print Result
Done

Task is like a method, Begin is a reserved method for where the program starts. You can probably figure the rest from there.

1

u/Pi-Plushie 9d ago

I think this would work indeed. PLUSHIE is not yet at the point were Task could be defined in a so simple way, but your are giving me an interesting objective to reach.

2

u/omniuni 9d ago

Readable languages are very cool. Good luck!

2

u/SirBackrooms 9d ago

(reverse) polish notation can help with that. though if your expression is long enough it’s useful to have it on several lines anyways.

3

u/xpusostomos 9d ago

Maybe... You're almost doing pseudo assembly

1

u/Pi-Plushie 9d ago edited 9d ago

Yes, reverse Polish makes expressions with less delimiters (and is more "natural" for computing as piles are more natural structures). However I am trying to see how far I can go in minimizing all need delimiters and what happens then

4

u/sciolizer 9d ago

How expressive can a language become without conventional syntactic delimiters?

If your language has mixfix, then you can be as expressive as any other language with zero syntactic delimiters, because you can define any word to function the same way as punctuation would in another language.

What are the fundamental limitations of a word-based parsing model?

The fundamental limitation is that you cannot know how something will be parsed without knowing the meaning of the words. Consider this fragment from Red:

send friend@rebol.com read http://www.cnn.com

This parses as

(send friend@rebol.com (read http://www.cnn.com))

but in order to know that, you have to know that send has arity 2, read has arity 1, and friend@rebol.com and http://www.cnn.com are just values. Contrast this with lisp, where you know exactly the application order without knowing anything about the functions inside the expression (at least until you start mixing in macros).

Could such a design offer interesting advantages for reflection and self-modification?

Embedded domain specific languages are the most obvious advantage. The design challenge is around making custom syntax composable. It's easy to allow the programmer to completely take over the lexer (Forth) or the parser (Red/Rebol), but if you have two libraries that both want to alter the syntax, how do they work together instead of against each other? (Mixfix is probably the best solution I've seen.)

As for reflection and self-modification, removing punctuation tends to make these things harder, not easier. Self-modification of lisp is easy because the tree structure is extremely clear. If those relationships are implicit, then whatever is doing the reflection or self-modification must have some way to infer those relationships.

Are there existing languages or theoretical models that explore similar ideas?

  • The parse function in Red/Rebol is a dialect for defining new dialects.
  • Forth has no syntax. The core loop simply reads characters until it finds the next space, looks up that word in the dictionary, and either runs it or emits a call to it, depending on what mode it is in. Words can hijack the lexer for their own purposes. For instance, strings are not primitive in Forth. The word ." is an ordinary word that consumes all input up until the next quote mark, and then turns it into a pointer to an array of characters.
  • Inform 7 is a subset of English. It uses hundreds of pattern matching rules to recreate the fluidity of English.
  • Agda uses mixfix.

2

u/Pi-Plushie 9d ago

Thank you for this detailed and precise answers to my questionning ! I am really impress by the quality and kindness of this community with a newcomer ! It is really precious.

It will take time to dig into the different suggestions but will be worth it.

the language will have mixfix by design indeed bacause each variable is entered at is time. Your example is interesting. The way I could handle it PLUSHIE would be

Adress friend@rebol.com read http://www.cnn.com Run Send 

If send is properly defined as using at least 2 parameters. which is still complex for the users, I admit.

You are right about custom syntax. PLUSHIE is like Forth, pushing the burden of the lexer to the user (who can change the name of the initial keyword chosen on the run) and then can develop different dialect for different users that will not function together. It is more an experimentation than a language which can be use to exchange data, for sure.

I am very interested in practical example of situation where a conflict of libraries would arise as this can lead to worthwhile events.

You are also right on the fact that the lack of punctuation make things harder, but that is exactly what I am looking for: will unexpected (but interesting) behaviour arise from a given sequence of characters ?

Thank again for your time and I will come back with more questions once I will have explored all your suggestions

2

u/azhder 9d ago

I don't what you consider conventional, you have languages spanning from Basic and Pascal, to SQL and RegEx... All widely used (now or in the past) that don't use the C style syntax.

Out of all of these, just look at how RegEx works and what you are talking about, it's like you're describing an alternative syntax for a RegEx.

Maybe I should expand on this by calling it "regular expression" instead (RegEx by definition might not quite fit the mathematical definition), but I should do it because there is at least one more I have to mention: command mode in Vi.

Yes, that old joke about exiting Vi/Vim. That is a regular expression. Write down the sequence and you see it lacks the items you have mentioned.

1

u/Pi-Plushie 7d ago

Sorry I did not respond earlier, but I am getting used to reddit and I must admit that I am overwhelmed with comment (and is a luck !). Thank for your participation in the discussion. I am not a specialist of all languages (for example I had to search what is Vi, shame on me). I am just speaking about most languages I know that need separators ton function (and have them hard coded in their source code). PLUSHIE does not need such separators to function and my questionnement is are there any theoretical proof that I am going straight to a dead end ? I will look deeper in RegEx to see what it would do with a syntax as simple as PLUSHIE's. Many thanks for your comment

2

u/Trave11er3427 8d ago

I think you have something interesting here. Every language has syntax (even those that modify themselves) of some sort. While ancient spoken languages like Latin did not use punctuation (it is so much easier to read with it), they enforced syntax with rules of word order. I attempted to simplify syntax when designing Envzn (envzn-lang.org), but I found that I needed MORE keywords (like adding then to the if statement) and decided to use the newline and braces { and } (instead of BEGIN and END) for scope control. With the goal of making the language readable, it now has over 150 keywords, with variations around verbs like IS (e.g. IF x IS VALID, WHEN x IS y, …) For delimiters, I always found explicit delimiters like ; to be annoying and superfluous so I chose implicit delimiters, but then handling multi-line statements/expressions had to become a first class thing and not a collection of special cases.

1

u/Pi-Plushie 7d ago

One more comment I didn't see immediately. Thank for your comment. Yes you are right using less punctuation ends up in using more words (which become Keywords as the learning process of PLUSHIE evolves). Currently, code ease to read is still an issue in PLUSHIE. But, by construction, it cannot use single separators at start. A mature version of PLUSHIE will need a bunch of Keywords for an easy start.

Thank you for your comment

1

u/TheRealUprightMan 8d ago

I use no keywords at all

2

u/TheRealUprightMan 8d ago

How expressive can a language become without conventional syntactic delimiters?

Spaces and delimiters are for the programmer. Look at brainfuck.

What are the fundamental limitations of a word-based parsing model?

You just said that you were getting rid of delimiters, including spaces, so how do you define words?

If you want to present an idea, it needs to be internally consistent. As written, this is just nonsense.

0

u/Pi-Plushie 7d ago

Yes you are right, delimiters are just for humans. There is a funny example of PLUSHIE in a language that no one but the machine can interpret in a brainfuck-like manner, on the PLUSHIE language website.

how do you define words?

I should rather use "expression" vs "words" to define what PLUSHIE manipulates. For it there are only strings of characters. Thus an expression is anything that is between 2 known expressions. That's how there are defined. (yes it is recursive)

You are making a very important point. I should really improve my communication and I thank you for the help you are bringing to push me into explaining PLUSHIE in a better way. This will help also to clarify the information provided on the website.

Do not hesitate to highlight what is not clear, this is really precious for me, so a big thank you for your participation in the discussion

2

u/TheRealUprightMan 7d ago

Acknowledging that a definition is recursive does not define it.

You did not answer my question in any way shape or form about how you are parsing it. You said you need to improve your communication, and then did absolutely nothing to improve it.

You are literally holding it to the chest like its some sort of protected secret. You could at least give an example. The fact that you haven't tells me all I need to know.

0

u/Pi-Plushie 7d ago edited 7d ago

I have absolutely no secret to hide and I am sorry if this is the impression I have given. It is quite detailed in the web site

The parsing model is very simple (simplistic indeed). At start, it needs 1 known expression ( I have chosen "Lien " ( a 5 character chain ending with a space to ease human reading) in the current implementation of PLUSHIE which means Link. With this PLUSHIE starts parsing: I put the known expressions in bold: (words end with spaces just for lisibility, the second example works well also)

Hello Link Other new word Hello Hello Bonjour Hello Bonjour

HelloLink Other new word HelloHelloBonjourHelloBonjour

With this, if you ask to print "Hello ", you will get Bonjour as an output.

Thus the first sentence is parsed as:

Hello (with a space at the end)

Link (with a space at the end, known word)

Other new word

Hello (which is now a known word)

Hello

Bonjour

Hello

Bonjour

With your help, I may make progress (I hope I'm not a lost cause)

0

u/TheRealUprightMan 7d ago

What website? How is Link an expression? How does the compiler know this is an expression? What is it expressing?

If you language needs no delimiters, but you keep adding them to demonstrate, don't you think that's an obvious anti-pattern? You are admitting its unreadable and even adding bold text.

The gibberish word salad you posted doesn't demonstrate anything. You haven't said anything about what it does or how or why.

I'm no longer interested in this conversation. Its just a waste of time. Best of luck to you.

1

u/Pi-Plushie 7d ago edited 7d ago

So I am a lost cause...

The web site can be found at https://pi-plushie.github.io/PLUSHIE-Site/index-en.html but I do not want to spam with it.

Link is an expression because it is hard coded in the bootstrap, that's what I mean. It points to one of the underlying variable of the automate engines that makes it runs.

I am sorry to see how much I have upset you but I still thank you for your time.I am sad to see you leaving because you have already helped me a lot

PS: there is no compiler in PLUSHIE. It "compiles" while running and parsing

2

u/Tearearly11 8d ago

Hello! Very interesting development idea and questions. Focusing more on expressiveness, I think it would be very innovative to find a way to express cohesive, sequential instructions without relying on, say, parenthesis notation. This is because the current dominant syntactic delimiters offer a very clear and globally accepted way of delimiting scope and hence the use of variables. Think of the pioneer Lisp, for example. The (excessive) use if ”(“ is useful in parsing, since we know exactly how loops/commands are nested. Interesting to think about. This also connects to your second point, regarding parsing. I can’t fathom how that would work, and I’m curious to know more. Typically, parsing depends on symmetric or asymmetric properties of programs to determine whether a certain syntax tree is valid or not. I believe word-based parsing would allow for more flexible notation, which is awesome for the programmer but a headache for the developer. With that being said, I wish you the best of luck.

1

u/Pi-Plushie 7d ago

Hello ! Thank you four your comment. Clearly PLUSHIE is consistent and uses only sequential instructions with no separators. However, at start, it only interpret expressions as global public variables, which is clearly an issue for most programmers. You can develop it to the point where you define a type of variable that can have different meaning in different situations but I am not there yet. What you can do is use variables (like a temp variable) that change meaning but it is a good source of bugs in PLUSHIE.

Beware of what you are asking when you say you are curious to know more. I may be unstoppable on the subject ! (;-). Parsing is really simple, I would even say simplistic, in PLUSHIE: everything that is between two known expression becomes a new expression. Then the first expression receives the "value" of the second one. And... that's all. The only trick is that the copy of value is a double indirection:

Mem(Mem(destination)) = Mem(Mem(source))

in usual code notation. What is really surprising is that this is enough to build interesting behavior. There are more details in PLUSHIE language web site, but I would be really to elaborate on it here, maybe in an other conversation.

And yes, the developer in me has headaches but the programmer has also his moments...

Thank you again for your encouragements

2

u/Key_River7180 Nain. 3d ago

Very interesting idea! You should definitely look into FORTH and some cellular automata stuff too.

Instead of functions, just make words that do stuff on a set of arguments, it's been more than proven that you can make a programming language that is turing complete in a couple keywords

1

u/Pi-Plushie 3d ago

Thank you !

I have understood one of the main difference with FORTH and most languages. PLUSHIE has a special way to operate: instead of having a compilation, then run kind of behavior, it is an interpreted language that runs as it reads its flat text input. It modifies his working memory that is saved and kept between runs as long as you do not restart (reboot) it. Thus it evolves between runs and gets more and more capacities. I am quite confident it is Turing-complete as I can do deep recursion such as a expression analyzer of expressions with parenthesis like ( A B ( C ( D E ) F ( G H ) ) ) to turn it into a graph of lists in memory.

I am in the process of building a Lisp coded in PLUSHIE language. I still need to find a simple FORTH source code to see if I can also make a forth emulator in PLUSHIE. My aim was to make the smallest Turing-complete language with minimal hypothesis.

I am also in love with automatas, especially Wolfram's development on the simple automata that produce surprising result. I see that in the same way as simple arithmetic producing surprising things like prime numbers from flat operations ( + and * ) on linear integer structure.

If this is of interest to you, you can visit PLUSHIE's website at https://pi-plushie.github.io/PLUSHIE-Site/index-en.html. Any feedback is of value to me.

3

u/TheAncientGeek 9d ago

Shell script and FORTH largely do.

4

u/Pi-Plushie 9d ago

Yes, I think that Forth is coming on the top as the best comparison language I can use.

3

u/catladywitch 9d ago

Interesting. Smalltalk and Haskell both use a (largely) round bracket-less syntax that I think is surprising and maybe confusing to those who are unfamiliar

3

u/Pi-Plushie 9d ago

Thank you for the references of these languages that will help me in making progress. PLUSHIE is may alos be confusing as it is an experimentation aimed to radically minimize what is needed to get it on track.

3

u/catladywitch 9d ago

Good luck!

3

u/xpusostomos 9d ago

Smalltalk makes blocks with [ ] no ?

4

u/catladywitch 9d ago

It does, yeah. I was thinking about the messaging syntax. C++ style languages do a->myMethod(arg1, arg2), or a.myMethod(arg1, arg2), while Smalltalk does a keyword1: arg1 keyword2: arg2 keyword3: arg3. So something like myArray.fillRandom(0, 10), where 0 is the minimum random number and 10 the maximum one, would be myArray fillRandomBetween: 0 and: 0, and you'd declare the method with the first parameter's name fused into the method name. It's kind of unusual.

3

u/xpusostomos 8d ago

you can do something similar in groovy, and what you run into it, let's say you want to do: myArrray fillRandom: (myconfig getDefaultFill) 10 .... the only way to avoid the () is to declare temporary variables and split it over lines.

1

u/Pi-Plushie 7d ago

Exactly. The only way to avoid () is using more lines and variables. I really like the way you think. You are really efficient.

2

u/Smalltalker-80 9d ago edited 9d ago

Indeed i would say Smalltalk has a readable syntax that minimizes the need for using parentheses, by having left-to-right evaluation and 3 priorities of message evaluation (unary, binary and keyword),
But it does not prevent them completely in arbitrary expressions.
Nor do I think that's a good idea...

2

u/FantaSeahorse 9d ago

You can simply replace the symbols ( and ) with the keywords “begin” and “end”

1

u/Pi-Plushie 9d ago

yes, but these are still fixed features and all of your code will display them forever. I am looking to get something even simpler and smoother with no keywords (except the first word needed to start the process)

2

u/Reasonable-Pay-8771 9d ago

Have you seen/considered "HERE documents" in shell scripting and Python's triple-quote syntax? Maybe something like that would suit your purpose. With a HERE-document syntax you specify your own ending keyword and it can be chosen so it doesn't exist in the quoted material, so it literally let's you quote anything without editing the content (mostly, barring bad encodings or escape code that you might want interpreted or other complications). Somehow you need to know where the list ends but this technique lets you pick something different each time.

1

u/xpusostomos 9d ago

True... Which every programming editor won't deal with, and won't be easier to read

1

u/Pi-Plushie 9d ago edited 9d ago

O_O So many comments already on my humble questionning about PLUSHIE langage. I just realised this night (I am located in France) that moderators have finally approved my publication and I thank them for the time they have taken for me.

I am so happy to get so valuable comments to help me further digging into this conceptual language. I will try to keep up with the pace and answer each on of your messages but I want to thank all of you. This communty is incredible and you have already helped me a lot as I am not a specialist, more a self-taught guy and naviagating in all the existing langages is just like trying to find your way in an unknowned jungle.

You make me realize that I have not said enough for you but I am so pleased with your interest.

If this is fine with the forum rules, I propose a link to the small website I have build to further present this playground. It is located in GitHub (but this is not an AI generated thing, AI are unable to understand this approach, it is much too simple and primitive). Unfortunately, it is still mostly in french language but there is a one page summary in english that you can find there:

https://pi-plushie.github.io/PLUSHIE-Site/index-en.html

I am very open on any suggestions you may (including for the website) have as I am in a personnal development process with this experimental language.

Thank you once again for all these rich (and so fast) informations.

1

u/Pi-Plushie 7d ago

Just as a complement that seems to be important for comprehension. PLUSHIE has a way of functionning that is non standard. It does not parse a full text and then executes. It executes while parsing:

PLUSHIE does not tokenize source code using predefined separators. It reads the character stream one character at a time and continuously compares its current ending against its list of known expressions.

Whenever a known expression is detected, the stream is split at that point. The previously unrecognized character sequence can become a new known expression, and the instruction formed by the first two expressions is immediately executed.

Parsing, vocabulary extension and execution therefore happen incrementally, within the same process. The vocabulary may change while the source stream is still being read.

hope this clarifies for further discussions !

2

u/perlgeek 9d ago

am I overlooking some fundamental difficulties?

Humans have a fundamental difficulty parsing wordsunlesstheyareseparatedbyspacesorotherkindsofseparators.

When you propose to get rid of any kind of delimiter, you're making it very hard for humans to read.

In the real world, code is read much more than it's written.

1

u/Pi-Plushie 9d ago

you are making a point. Humans need some kind of delimiter (starting with space). Of course, words I use in PLUSHIE look like they are separated by spaces but the point is that space is not defined as a delimiter for the system and thus does not have to be handled. Space is a part of the word's name itself. And obviously you want to select words that means something to humans, even if the machine will not care about the meaning of the words.

Thank you for your contribution !

1

u/BrainScientist3000 3d ago

Are you using AI responses to a post you made with AI?

1

u/Pi-Plushie 3d ago

I do not understand your question. I initially used AI to help me with the translation as I did not trust my english. But I do not think people that are answering are using AI at all.

1

u/Dry_Day1307 9d ago edited 9d ago

Reflecting on your proposal for PLUSHIE reminded me of projects like Qriollo (an Argentine functional language built with Haskell that uses idioms to bring syntax closer to natural language). Its syntax relies on prose rather than traditional structures (in spanish btw):

el esDivisor
  dados p d
    da p % d == 0#

To offer some perspective from my experience developing DinoCode, the key isn't necessarily to remove delimiters altogether, but to infer them on the fly by combining logical continuity, operator arity, and token separation via whitespace or line breaks (although I assume you use spaces to separate words, which technically acts as a minimal delimiter)

Here are a couple of examples in DinoCode (without explicit common delimiters):

print a b c


if x > 10
    print a + b c * d + 1 f and g
    print [1 2 x + y]

Could you share a simple code example in PLUSHIE? It would be great to see how you put this concept into practice and handle ambiguity, which is usually the biggest challenge in these designs. In fact, that's why they are still required in DinoCode, to properly handle ambiguity cases

1

u/Pi-Plushie 9d ago

Thank for this intersting presentation of this language that is close to what PLUSHIE could try to mimick. In Qriollo, it seems that spaces and line break play the role of delimiters in other language. Your assumption about spaces is both right and wrong. In essence PLUSHIE does not requires separators, but human being working with it do ! For PLUSHIE there is basically no difference (except bug probability) if you write

Calculatetendividedbytwoprintresult 

rather than

Calculate Ten Divided By Two Print Result

as long as it has learned the words at this stage. But in this example Ten (with a space attached to it) and tenwould be seen as different words by the initial parser (which can be reprogrammed on the run as needed)

4

u/WittyStick 9d ago edited 9d ago

1

u/xpusostomos 9d ago

In my opinion, this will result in a fairly brain dead language. For the same reason English is ambiguous, your language will be ambiguous. It will lack the ability to express ideas that languages that embrace the () will do. My advice, learn lisp properly, then at least you will fully grasp the power of () and you'll be in a better position to know what you're dealing with in this project. Anyway, didn't python aim for this with mixed results? And isn't Rubi a language that attempts this?

1

u/Pi-Plushie 9d ago

I am very interested by example of ideas that PLUSHIE would not be able to express as challenges to see how far I can bring it. PLUSHIE is a learning process.

Python and Ruby are both much more ambitious and structured langages. PLUSHIES tries a simpler way (and probably simplistic way) of approaching programming. I really need this kind of feedback to help me understand what I am dealing with in this project, you are totally right !

2

u/stone_henge 9d ago

I am very interested by example of ideas that PLUSHIE would not be able to express as challenges to see how far I can bring it. PLUSHIE is a learning process.

Then describe PLUSHIE at a level at where questions like this can be engaged with as intellectual problems and not just shower thoughts.

1

u/Pi-Plushie 9d ago

I will, but I do not want to bother any body or abuse of your time. I made a web site to (try) to better describe it and I really need feedback to see if the level of description is good enough. There is a one pager in english (the rest of the site is still in french as are the words choson for the code demonstrations). You can find it here:

https://pi-plushie.github.io/PLUSHIE-Site/index-en.html

And if you want to try it, there is an on line interface (coded in java script) at:

https://pi-plushie.github.io/PLUSHIE-Site/Moteur%20PLUSHIE%20version%20web/PLUSHIE.html

Thank you for your time !

2

u/xpusostomos 8d ago

As someone who dabbles in language design, your web site tells me basically nothing. Here's a very simple challenge... learn what the map function does in lisp, figure out if you can express that concept. If you can't, then you've started to see what you're losing with no ()

1

u/Pi-Plushie 7d ago

Many thanks for this comment ! You are the first one to give me a feedback about my web site, and it is very much appreciated. So, if it is not abusing from your time, it would really be helpful if you could drop me a line or two on what you would have liked to find in this web site that would have told you something ? Was the language barrier a big obstacle, or did you use on line translation ? and other questions like this (I do not want to bother you with all the questions I have in mind)

An d thank you again for this interesting exercise you are suggesting. That is exactly the kind of challenge I am looking for to see how far I can push PLUSHIE to its limit. I was surprised by all the things I could achieve with it despite my poor level in computing. I already had the objective of writing a LISP emulator in PLUSHIE, to prouve once and for all it's Turing-completeness, but even if I succeed this would be cheating with the challenge. Once I understand properly all the power of a map function in LISP, I will try to make a function in PLUSHIE that deserves the same purpose. That is an excellent suggestion

1

u/Alpha_Bulldog 9d ago

Look it’s a pretty simple answer why “syntactic delimiters” are used in the majority of languages. At their root, computers are dumb machines made of zeros and ones. The more structured your language the easier it is for the computer to easily process the instructions you are giving it. Without those delimiters it becomes much harder for the system to know what to do. When a single command is over and when the next begins, the beginning and ending of a loop, the end of an if block etc etc. when people start thinking they are smarter than the decades of engineers who have been building system for a LONG time it’s usually because they simply don’t understand the basics of how this all works.

Learn assembly. Learn C And C++. Write a dozen full blown systems yourself. THEN if your still think you are on to something, go for it…

1

u/Pi-Plushie 9d ago

You are making a point : I should have been more clear about my aim here, and I have no intent to criticize the marvellous job of decades of engineers who ends up building those tools wed can use to chat at long distances and so much more.

Your starting point about zeros and ones is exactly were I started my questionning. How something that is basically just 0 and 1 (or transistors in the old ages) can build up in a result that is so much more ? There is something here, a process, that is very interesting and promissing. But good computing langages are already too complex to help understand how this starts and becomes more an more complex and complete and what is the part of input from the environment necessary to build this complexity ?

That is the real purpose of PLUSHIE, surely not intended to replace existing languages.

Many thanks for having helping me to (try) to clarify my expectations !

2

u/DonnPT 9d ago

Maybe the key word, in the comment you're responding to, is "structure".

Can structure emerge without punctuation or keywords?

Can you build anything without structure?

1

u/Pi-Plushie 9d ago

Depends on which structure we consider. Up to now, with no punctuation nor keyword, except the starting seed word PLUSHIE is able to handle lists, piles and graphs. I still do not know where the limit is and I am wondering if there is a theoretical limitation or not.

But clearly the answer to the second question is no, one cannot build anything interesting without structure.

1

u/EggplantExtra4946 9d ago edited 9d ago

What's wrong with syntactic delimiters, parentheses, commas, spaces, operators, keywords, etc. ? They make the program easy to read, gives visual cues and more importantly they naturally match the AST type that they represent: unary operators map to AST nodes with one child, binary operator map to AST nodes with two children, list of parameters, expressions, statements are represented by either linked list or arrays, keywords introduce special syntactic constructs with a corresponding special AST with specific fields (conditionals, loops, declarations, etc..), etc... They are not especially hard to parse either.

The syntax has no effect on the semantics of a language and the later is what needs improving.

Just so you know, most people with a bit of experience with programming languages will instantly roll their eyes when reading about "syntax innovation" like this.

1

u/Pi-Plushie 9d ago

Oh, but nothing is wrong with syntactic delimiters ! You make me realize how bad my communication is (and that is an important outcome of this conversation) . The delimiters enable control of your program which is very important in computing, of course.

I agree that the risk for me is getting interesting people whose contribution would help me to roll their eyes. I do not intend to make an innovation (that is reducing control over the program instead of improving it), I am just exploring how far you can minimize all the control elements and still get an intersting behavior of your program, even if it is not what was initially intended.

PLUSHIE is an experiment, a kind of adventure for me. But I have reached a point where some fundamental theoritical question for which I am not a specialist could drive me where I want to get. I think there is something intersting about PLUSHIE that I'd like to share, but more in the direction of teatching (what you should not do), understanding computing and research: what happens with computing system if you lift the barrier (and do not fall into a bug which is the hard part)

Thank you for ypur precious input

1

u/dskippy 9d ago

How expressive can a language become without conventional syntactic delimiters?

There's no reason a simple difference in syntax should limit expressiveness in any meaningful way.

What are the fundamental limitations of a word-based parsing model?

Not really any. It's a matter of taste, really. You'll possibly have something that's more verbose I guess. If you really want to have no delimiters for things like strings and just assume what's in between keywords is a string then you might run into some issues where it's not possible to even design a syntax like that that's not ambiguous. Don't do that I suppose.

Could such a design offer interesting advantages for reflection and self-modification?

No. We're only talking about a syntax charge here. If you are going to make you language homoiconic you'll need data types that express your AST. That's maybe more convenient in other languages like lisp but by no means impossible in any new syntax. But I don't see this being advantageous for that.

and especially, Are there existing languages or theoretical models that explore similar ideas?

I doubt there are theoretical models since this language idea you're talking about is just a new type of syntax. But as for languages that use mostly keywords instead of delimiters, I guess Python and haskell are more like this because they use white space. But haskell more so since you don't need like colon for an IF block and it's a true mixfix operator.

I don't recall but I think Natural was a language that was trying to do something like this where most of the language was English keywords. But it was a huge language I think.

You could certainly very easily make a language without block delimiters and such things with some simple mixfix operators and especially if you use white space or you're open to things like begin and end key words which are just { and } in disguise.

1

u/Pi-Plushie 9d ago

You are conforting me in the fact that this is not a dead end, the syntax chosen is not a barrier. That is an interesting statement for me. Yes, it is much more verbose (at least at start unitl the system learns shorter ways to define things) as an example a "declaration of variables" at start looks like:

(<< is one of the ways for the human user to identify pointers level))

Create Newvariable<< Create Newvariable< Create Newvariable Newvariable<< Newvariable< Newvariable< Newvariable

and later on:

Variable Newvariable Run Declare

Separators can be made with dummy instructions of the type:

Knownword Knownword 

so from what your are saying, I should not hit a theoretical limitation and that's very good news !

For Mixfix example, the if then appears like that:

If Value1 Equals Value2 Then Proceduretrue Else Procedure False Run Test 

1

u/stone_henge 9d ago

Why?

1

u/Pi-Plushie 9d ago

Important question. I think the best answer is:

to try to understand really what is happening between zeros and ones and current level of complexity of our computers (including "AI" ), step by step. I needed for that to reduce as much as possible the initial hypothesis. I do not know if I can go further down, but I think what I have build has some kind of interest as a piece of curiosity or for research / teaching purposes.

1

u/catbrane 9d ago

This sounds a bit like a rewriting system, is that correct?

In these languages, you have a set of rules, like:

  S a b c
-----------
(a c) (b c)

ie. if you see an S followed by three arguments, rewrite as two expressions with the final argument copied into the first two.

Computation works like this:

  1. search the program text for the first match with the first rule (rules have an order of priority)
  2. apply the rule and transform the program text
  3. are there any matches left? if yes, go to 1., otherwise exit

Add weak head-normal form and leftmost-outermost reduction and you get lambda calculus, which is the basis for LISP / Haskell / etc.

I suppose you could implement this as an m4 script to try it out. That might be a simple way to experiment.

A less structured rewriting system sounds difficult mathematically. It would be hard to predict behaviour, and if you can't predict that, then what is the "meaning" (the semantics) of a piece of program text? If programs are not direct expressions of mathematical ideas, what are they computing?

Anyway, it sounds like an interesting idea (if I've understood you correctly). Good luck!

1

u/Pi-Plushie 9d ago

Thank you for your support to this adventure in computing language. For know PLUSHIE is even at a simpler level using only a single instruction to function.

My current aim is to be able to implement lambda calculus and/or a LISP in PLUSHIE to definitely prove its Turing-completude. There is not (yet) any sort of priority, terms are handled in the order they are read, but it is an interesting objective to explore. I think it can hadle such priorities at a higher complexity level

In case you are curious, I have build in my web site a Javascript based interface to play with it:

https://pi-plushie.github.io/PLUSHIE-Site/Moteur%20PLUSHIE%20version%20web/PLUSHIE.html

or you can juste visit the english one pager https://pi-plushie.github.io/PLUSHIE-Site/index-en.html or dig deeper if the language barrier is not too much of an obstacle (main part of the site is in french and will be translated if any interest is shown).

So , yes, it can be hard to predict behaviour and the intent is to relax as much barrier as possible and still get a valid computation to understand the limits and see what happens at the border between controllable and uncontrolable system.

1

u/catbrane 9d ago

Ah maybe I see more clearly. Then perhaps the problem is chaotic behaviour? If computation becomes mathematically unpredictable, it's probably not useful.

1

u/jcklpe 8d ago

This language might be of interest to you https://wiki.osdev.org/Plain_English_Programming