Discuss Scratch

rdococ
Scratcher
1000+ posts

Custom Programming Languages

gilbert_given_189 wrote:

(after looking at some other languages people have made, I've realized that this kinda resembles another language here…)
Don't worry about it. Your language actually works quite differently.

Last edited by rdococ (Oct. 14, 2023 01:27:13)

davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

gilbert_given_189 wrote:

I had an unfinished proglang that only has the (abstract) interpreter and parser done called Gravy. Its name is a corruption from “curry”, as in currying, which this language uses a lot. That might make it a highly functional language (which, depending on your defintion of “highly functional”, it might be), but it defines some object-oriented paradigm like the object-like “scopes”. (thus, the corruption on the name)

snip
That's probably the most unique language I've seen. Very cool!
Could you return an atom that does an action? Like this:
fn foo() {
return + "foo";
}

print("abc" foo() !); # prints "abcfoo"

Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
Carmiller24
New Scratcher
2 posts

Custom Programming Languages

I'm (poorly) creating a programming language called Elmwood (Written in Scratch). I need to revamp the syntax, but the goal is to keep it simple.



“Some people are immune to good advice.” -Saul Goodman
TheSecondGilbert
Scratcher
100+ posts

Custom Programming Languages

davidtheplatform wrote:

gilbert_given_189 wrote:

I had an unfinished proglang that only has the (abstract) interpreter and parser done called Gravy. Its name is a corruption from “curry”, as in currying, which this language uses a lot. That might make it a highly functional language (which, depending on your defintion of “highly functional”, it might be), but it defines some object-oriented paradigm like the object-like “scopes”. (thus, the corruption on the name)

snip
That's probably the most unique language I've seen. Very cool!
Could you return an atom that does an action? Like this:
fn foo() {
return + "foo";
}

print("abc" foo() !); # prints "abcfoo"
There's a syntax for functions on the parser grammar. It accepts a single atom or a line encased in parenthesis (a single word, you might say).
Some examples:
\a.a; # function \a.(# at MEMLOC)
\a.a 1; # number 1
\a.(print (a));
The mechanics of it isn't set in stone yet, but one plan is to use some internal scope with the atom as the argument of it. When called, the input would be stored in the scope as a constant value.
(By the way, I forgot to mention scopes can also store constant values. Calling it with the keyword `let` allows you to store a variable as is. For example, {let a := 1; print (a)} will print 1 (note that you don't have to give `a` the keyword `!`, since `a` is already a number). The downside of this system really is that it creates redundancy with the names; there's one stored in the scope and one in the field itself.)
There might be special cases for parenthesis and scopes, but what and how I'm not quite sure yet. I need to further work on the interpreter if I had to figure that out.

Hi! This is an alt of my main account.
I'm “back” from a 10-month hiatus.
I forgot the ways of the forums, so I might be wrong.
My first post!
Redstone1080
Scratcher
1000+ posts

Custom Programming Languages

Sorry for not posting on this. I would normally quote-reply some of these posts but they are way too long lol

Carmiller24 wrote:

I'm (poorly) creating a programming language called Elmwood (Written in Scratch). I need to revamp the syntax, but the goal is to keep it simple.
I tried making one a while ago, called Thatch. The first version of it, called Linear Thatch, can be found here

Maintainer of Snazzle | User of Linux (Fedora in particular) | Fan of Rockets
rdococ
Scratcher
1000+ posts

Custom Programming Languages

Redstone1080 wrote:

Sorry for not posting on this. I would normally quote-reply some of these posts but they are way too long lol

Carmiller24 wrote:

I'm (poorly) creating a programming language called Elmwood (Written in Scratch). I need to revamp the syntax, but the goal is to keep it simple.
I tried making one a while ago, called Thatch. The first version of it, called Linear Thatch, can be found here
The easter egg is a nice touch

-

I've got a VM and interface for my language up and running!

The working name for this language is escript. I call it that because “OScript” was taken, and E has the closest object model I could find to it, though the only real similarity is that E and escript both lack classes - instead, objects are essentially records of closures you can create at any time. I'm looking for better name suggestions before release.

Also, any suggestions for better assignment syntax are welcome. Right now it's `<-`, but that blends in with the `->` method/lambda syntax, and while writing the above example I initially typed `:=` by mistake.

Last edited by rdococ (Oct. 18, 2023 13:51:44)

gilbert_given_189
Scratcher
1000+ posts

Custom Programming Languages

rdococ wrote:

Redstone1080 wrote:

Sorry for not posting on this. I would normally quote-reply some of these posts but they are way too long lol

Carmiller24 wrote:

I'm (poorly) creating a programming language called Elmwood (Written in Scratch). I need to revamp the syntax, but the goal is to keep it simple.
I tried making one a while ago, called Thatch. The first version of it, called Linear Thatch, can be found here
The easter egg is a nice touch

-

I've got a VM and interface for my language up and running!

The working name for this language is escript. I call it that because “OScript” was taken, and E has the closest object model I could find to it, though the only real similarity is that E and escript both lack classes - instead, objects are essentially records of closures you can create at any time. I'm looking for better name suggestions before release.

Also, any suggestions for better assignment syntax are welcome. Right now it's `<-`, but that blends in with the `->` method/lambda syntax, and while writing the above example I initially typed `:=` by mistake.
Just asking; what is the instruction set of the VM?
(don't be extensive, just explain some notable ones)

If you see a line above this text, it means that below this text is my signature.
This place is just a memory to me, I may return occasionally but I'm busy.
I guess I'm an ATer now.

I think I may have seasoned my posts a bit too much.
Also, my posts are getting lengthy lately. Whoops.


Colored Pencil is supposed to color the siggy, but Scratch says it's too big.


There is nothing here…



don don pan pan
dondo pan pan
rdococ
Scratcher
1000+ posts

Custom Programming Languages

gilbert_given_189 wrote:

-snip-
Just asking; what is the instruction set of the VM?
(don't be extensive, just explain some notable ones)
Well… I guess it's more of a straight interpreter. After converting your code to an AST (a data structure for representing programs) it recursively searches the AST, and methods on the syntax tree's nodes tell it what to do. Scratch does basically the same thing and calls it a VM, so I had ‘VM’ on my mind
rdococ
Scratcher
1000+ posts

Custom Programming Languages

EScript is now available to try here, source code at https://github.com/rdococ/escript. The canvas API is a gigantic work in progress though

Last edited by rdococ (Oct. 22, 2023 20:15:52)

uwv
Scratcher
1000+ posts

Custom Programming Languages

not at all a programming language but i've been working on a hdl (hardware descriptor language) specifically targeted at minecraft redstone. im not sure im super happy with the syntax (yet) but i am open to suggestions. i am calling it RDL (Redstone Descriptor Language) and unlike the syntax i am really happy with that

8 bit full adder:
import std/logic/*

assembly full_adder(a, b, cin) -> s, cout {
a, b
-> xor
-> (take r -> (
(
a, b -> and,
cin, r -> and
)
-> or
-> cout
)) & ( -> s )
}

assembly eight_bit_adder(a[8], b[8]) {
var last: full_adder

repeat sizeof a {
(
a[i],
b[i],
last[cout] ? 0
)
-> ( fulladder -> last -> )[s]
-> lamp
}
}

observer clock:
assembly clock() -> p {
observer > < observer -> p
}

silly little lamp example:
assembly lamp_example() {
lever -> lamp < observer -> lamp
}

Last edited by uwv (Oct. 30, 2023 07:39:45)


i use arch linux (btw) with the linux zen kernel and enjoy writing silly things in silly languages using silly frameworks
TheSecondGilbert
Scratcher
100+ posts

Custom Programming Languages

uwv wrote:

not at all a programming language but i've been working on a hdl (hardware descriptor language) specifically targeted at minecraft redstone. im not sure im super happy with the syntax (yet) but i am open to suggestions. i am calling it RDL (Redstone Descriptor Language) and unlike the syntax i am really happy with that

8 bit full adder:
import std/logic/*

assembly full_adder(a, b, cin) -> s, cout {
a, b
-> xor
-> (take r -> (
(
a, b -> and,
cin, r -> and
)
-> or
-> cout
)) & ( -> s )
}

assembly eight_bit_adder(a[8], b[8]) {
var last: full_adder

repeat sizeof a {
(
a[i],
b[i],
last[cout] ? 0
)
-> ( fulladder -> last -> )[s]
-> lamp
}
}

observer clock:
assembly clock() -> p {
observer > < observer -> p
}

silly little lamp example:
assembly lamp_example() {
lever -> lamp < observer -> lamp
}
How would lateral inputs work? (usually called “side inputs”)

Hi! This is an alt of my main account.
I'm “back” from a 10-month hiatus.
I forgot the ways of the forums, so I might be wrong.
My first post!
uwv
Scratcher
1000+ posts

Custom Programming Languages

TheSecondGilbert wrote:

(#71)
How would lateral inputs work? (usually called “side inputs”)
i'm not sure yet, theres no way to do it in syntax, i might just skip giving it syntax and let the synthesizer figure it out

i use arch linux (btw) with the linux zen kernel and enjoy writing silly things in silly languages using silly frameworks
davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

uwv wrote:

TheSecondGilbert wrote:

(#71)
How would lateral inputs work? (usually called “side inputs”)
i'm not sure yet, theres no way to do it in syntax, i might just skip giving it syntax and let the synthesizer figure it out
You could do something like this:
back_input|left_input|right_input -> repeater

Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
IM-4-U
Scratcher
1 post

Custom Programming Languages

It is Possible! TO MAKE A CUSTOM PROGRAMMING LANGUAGE IN Scratch And i had made Print Comments
LTV2008
Scratcher
76 posts

Custom Programming Languages

I created a language based on Windows Batch Script that i nicknamed “Storytellers Batch”. Here is a example:

@talking ON
TITLE “foobar”
say “nope” & REM A remark that does not get executed
timeout 2
label mylabel
choice rc “Press R or C to continue”
if not choicelevel 2 (
say “R key pressed”
say “also nope”
timeout 3
goto mylabel
) else (
say “C key pressed”
timeout 1
say “yes”
)
key q “Press Q to continue”
for i in (10) do (
say “yay”
)
PAUSE
EOF

I plan on writing a SB to .BAT converter for it to work in Windows.

Last edited by LTV2008 (Dec. 7, 2023 01:38:55)

LTV2008
Scratcher
76 posts

Custom Programming Languages

Ok so I plan on making a thing called FluffScript. I alreday have the syntax, but can someone here create an FS to Javascript converter?

Here is the syntax:
the syntax

Powered by DjangoBB