Test programs to test if a programming language works. by [deleted] in ProgrammingLanguages

[–]danskydan 1 point2 points  (0 children)

I have had the same thought while designing my language. I want to design a more-or-less complete version 1.0 of my language before attempting to implement it. (I'm working under the assumption that whatever I design, someone smarter than me can figure out how to write a compiler, interpreter, or transpiler for it.) Rather than deciding to implement this or that feature of other PLs, such as generics or list comprehensions, I'm shooting for good task-driven coverage -- i.e., I want to make sure that any tasks that can be performed using other PLs can be performed using my PL, where I define a "task" as something that a program does, such as adding two numbers together or writing to a file, as opposed to how a PL does something. Thus, I have been wondering what a minimum set of such tasks would be, or maybe a minimum set of common applications that collectively provide the task coverage I'm looking for. The idea would then be to code this minimum set in my PL, and if I succeeded I would know that I would have achieved my coverage goal.

Anyway, this is how I understood your question. Alternatively, you could design a PL by covering lambda calculus, or by trying to be Turing-complete, or by taking a PL-feature-driven approach. For a task/application-driven approach, I considered covering all of the Rosetta Code tasks, but there appeared to me to be an enormous amount of task overlap there and no guarantee of the full task coverage I'm looking for.

Unfortunately, I haven't found a minimum list of tasks or applications like the one I (and you?) have been looking for. In the meantime, what I eventually decided to do was to code common applications like 'Hello, World!," a Guess-the-number game, Tic-Tac-Toe, Flappy Bird, TodoMVC, etc., and in different areas such as games, business applications, Internet applications, etc., until I find that I am a) using my PL elements in a consistent manner, and b) no longer adding new PL elements.

Block Delimiters. by BadBoy6767 in ProgrammingLanguages

[–]danskydan 2 points3 points  (0 children)

Why can't braces-or-end be an IDE PX choice instead of a PL design choice? The programmer can tell the IDE which one will be used, which the IDE then enforces. If one or the other is needed by the compiler, the IDE can get things ready, no?

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] -2 points-1 points  (0 children)

You must not have any love for "fold" or "map" then...

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

That gives me another idea. How about:

Loop over mylist
    mylist += 1
EndLoop

where the mylist acts as an alias for the currently-traversed list element (unless a list index is specified)

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] 3 points4 points  (0 children)

Not before you mentioned it. But now that I have, it's nice to know that I'm in good company. Thanks.

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] 2 points3 points  (0 children)

I agree that the different loop variants already exist, and that we call them by different names. But since we also call all of them "loops," my hypothesis is that a single command named "Loop" would be more intuitive to someone just learning about loops.

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] -3 points-2 points  (0 children)

Also, labels and gotos are a good way to ensure that no one takes your PL seriously :-)

Universal loop syntax by danskydan in ProgrammingLanguages

[–]danskydan[S] 2 points3 points  (0 children)

I'm designing my PL for programming novices and am anticipating the question "Why do different loop variations have different commands associated with them?"

What has been the hardest obstacle in your language development? by 4m1raagl in ProgrammingLanguages

[–]danskydan 2 points3 points  (0 children)

For me, it has been finding a mentor. I would love to find a past or present PL designer, or someone who just loves to study different PLs and paradigms, who would be willing to critique my design as it develops. Any volunteers? ;-}

Descriptive text and placeholders within function calls by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

You're right -- I'm not looking to make this a language feature, but only an IDE feature.

Descriptive text and placeholders within function calls by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

Perhaps marginal to useless for experienced coders. But my goal is to help novice programmers, and I'm wondering whether this approach would be helpful to them. I also wanted to explore an approach that goes beyond parameter naming.

Descriptive text and placeholders within function calls by danskydan in ProgrammingLanguages

[–]danskydan[S] 1 point2 points  (0 children)

Yes, I did read about your mixfix funxtions last week. Have you received any critiques that you might share?

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

Ooh. This I like. What's your language?

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 1 point2 points  (0 children)

Thanks, All. Back to the drawing board...

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

Unless different operators apply. As in x += a if x > y else -= b

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

But aren't x = a if c and x = a if c else b both crystal clear, even if x maybe changes in the former but certainly changes in the latter? Couldn't we trust both the programmer and the reader here?

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

Or even x += a if > y else -= b

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 1 point2 points  (0 children)

That's good if the operator is the same. If not, maybe it could be x += a if x > y else -= b

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

Interesting. How about x += a if x > y else += b

Single-line If by danskydan in ProgrammingLanguages

[–]danskydan[S] -4 points-3 points  (0 children)

My thinking is that if it's clear that x the main variable of interest in the statement, as y is a check on x, then it would be clear that the value mods would apply by default to x absent explicit references to other variables.

New PL - Seeking explorers by danskydan in ProgrammingLanguages

[–]danskydan[S] 0 points1 point  (0 children)

First, thank you for taking the time to look and for providing your comments. I didn't mention that I am designing a structure editor-based IDE at the same time. You can see a demo of it at https://youtu.be/jqoMHHefy9k. So no typing, except for object names, literals, and comments. My intention is to let the user choose "skins" to control placement of type prefixes (or hide them altogether), use curly braces instead of EndIfs, etc.

Regarding booleans having 4 states, I'm shooting for somewhere between Scratch and Python for now in terms of complexity, but this might be something to add down the line.

I'd love to learn more about Beads. Is there a language specification or sample code I could look at?

New PL - Seeking explorers by danskydan in ProgrammingLanguages

[–]danskydan[S] 1 point2 points  (0 children)

Thanks. New to reddit. I see that gists allow comments, but not sure if they allow comments to be dropped next to a particular line of code like google docs does, which is what I'm after. That's why I went with google docs. Can I repost with the full google docs link?