Discuss Scratch

Redstone1080
Scratcher
1000+ posts

Custom Programming Languages

Discuss programming languages you're:
a) in the process of making, so you can't make a topic yet, or
b) don't want to make a topic about :P

Last edited by Redstone1080 (Oct. 9, 2023 12:12:15)

Redstone1080
Scratcher
1000+ posts

Custom Programming Languages

I remember making a terrible lang once called Efflo. Basically it worked like Python bytecode but even more verbose :P

I think it's on GitHub somewhere
__Falcon-Games__
Scratcher
1000+ posts

Custom Programming Languages

Did you make this topic because of Sandwich?
PlNG_
Scratcher
500+ posts
__Falcon-Games__
Scratcher
1000+ posts

Custom Programming Languages

PlNG_ wrote:

Duplicate?
https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/612872
That is about writing a programming language, this is about discussion of programming languages we are making.
TheSecondGilbert
Scratcher
100+ posts

Custom Programming Languages

I had a language called Touché, a scratchblocks-like language that compiles into a Scratch project à la GCC, and is also made to be extendible so that it also works with mods and other block-based proglangs as well.
It's been put on the back burner since it's in dev hell for being too ambitious. The structure needs to be revamped since I don't know how to part compilers correctly (or at least in a flexible manner). I've also been struggling to find a suitable parser library (to the point that I had to briefly switch my language from Python to JavaScript) until I've decided to make my own (albeit inefficient) parser. Those and the unfortunate event of my laptop going into a coma recently, ceasing development of all my projects.

Moral of the story: If you want to dream big, at least know in detail what you're dreaming of.
__Falcon-Games__
Scratcher
1000+ posts

Custom Programming Languages

TheSecondGilbert wrote:

I had a language called Touché, a scratchblocks-like language that compiles into a Scratch project à la GCC, and is also made to be extendible so that it also works with mods and other block-based proglangs as well.
It's been put on the back burner since it's in dev hell for being too ambitious. The structure needs to be revamped since I don't know how to part compilers correctly (or at least in a flexible manner). I've also been struggling to find a suitable parser library (to the point that I had to briefly switch my language from Python to JavaScript) until I've decided to make my own (albeit inefficient) parser. Those and the unfortunate event of my laptop going into a coma recently, ceasing development of all my projects.

Moral of the story: If you want to dream big, at least know in detail what you're dreaming of.
Oh wow, I also created a Scratch-like language and it was much more simpler and easier for me.
Steve0Greatness
Scratcher
1000+ posts

Custom Programming Languages

I “recently” made a implementation of Bluefun(one of those weird Esoteric programing languages that doesn't serve a purpose). I say “recently”(in quotes) because I actually made it 2 months ago. It's repo can be found at @Steve0Greatness@github.com/Go-Bluefun.
It also added some extra features onto that language to make it less of a nightmare to write in… it's still not fun

Last edited by Steve0Greatness (Oct. 9, 2023 20:02:05)

davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

I'm thinking about making a sort of cross between python and java. I don't really know how to make a compiler though
sf97ahgf
Scratcher
100+ posts

Custom Programming Languages

AFAIK LLVM is great if you want to write languages without the hassle of creating compilers for multiple complicated instruction sets.
davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

sf97ahgf wrote:

AFAIK LLVM is great if you want to write languages without the hassle of creating compilers for multiple complicated instruction sets.
Yeah that's what I'm going to use
ajskateboarder
Scratcher
1000+ posts

Custom Programming Languages

davidtheplatform wrote:

I'm thinking about making a sort of cross between python and java. I don't really know how to make a compiler though
In a literal sense, there's Jython, which lets Python interop with Java and vice versa. I think it's stuck on Python 2 support though
davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

ajskateboarder wrote:

davidtheplatform wrote:

I'm thinking about making a sort of cross between python and java. I don't really know how to make a compiler though
In a literal sense, there's Jython, which lets Python interop with Java and vice versa. I think it's stuck on Python 2 support though
That's… interesting
The goal is more for it to have python-like syntax but also a sane OOP system, and be compiled. Static typing would be optional, but the compiler would try to figure out the actual type of something if you don't specify it.
Something that really annoys me with most OOP languages is that there isn't a native way to have a variable which can only be changed inside the class. You can emulate this by making the variable private and using a getter, but that feels unnecessary.
ajskateboarder
Scratcher
1000+ posts

Custom Programming Languages

davidtheplatform wrote:

ajskateboarder wrote:

davidtheplatform wrote:

I'm thinking about making a sort of cross between python and java. I don't really know how to make a compiler though
In a literal sense, there's Jython, which lets Python interop with Java and vice versa. I think it's stuck on Python 2 support though
That's… interesting
The goal is more for it to have python-like syntax but also a sane OOP system, and be compiled. Static typing would be optional, but the compiler would try to figure out the actual type of something if you don't specify it.
Something that really annoys me with most OOP languages is that there isn't a native way to have a variable which can only be changed inside the class. You can emulate this by making the variable private and using a getter, but that feels unnecessary.
Interesting language idea, but inferring types might cause compilation times to go completely beyond human comprehension

Also I totally agree with you, you shouldn't have to write getter and setter boilerplate to do something as simple as change a variable
davidtheplatform
Scratcher
500+ posts

Custom Programming Languages

ajskateboarder wrote:

davidtheplatform wrote:

ajskateboarder wrote:

davidtheplatform wrote:

I'm thinking about making a sort of cross between python and java. I don't really know how to make a compiler though
In a literal sense, there's Jython, which lets Python interop with Java and vice versa. I think it's stuck on Python 2 support though
That's… interesting
The goal is more for it to have python-like syntax but also a sane OOP system, and be compiled. Static typing would be optional, but the compiler would try to figure out the actual type of something if you don't specify it.
Something that really annoys me with most OOP languages is that there isn't a native way to have a variable which can only be changed inside the class. You can emulate this by making the variable private and using a getter, but that feels unnecessary.
Interesting language idea, but inferring types might cause compilation times to go completely beyond human comprehension

Also I totally agree with you, you shouldn't have to write getter and setter boilerplate to do something as simple as change a variable
The compiler would just check the places where it's assigned, and if they're all the same type the variable is static, otherwise it's dynamic. You already have to do this to detect type mismatches so it won't add very much compilation time.
ninjaMAR
Scratcher
1000+ posts

Custom Programming Languages

I made this really bad language similar to lisp
https://github.com/ninjamar/nm
__Falcon-Games__
Scratcher
1000+ posts

Custom Programming Languages

So to create an object in Sandwich you don't need to create classes first, here's how you do it.
import Console

fun main() {
obj = Standard.Object(a=1, b=2, c=3)
Console.out(obj.a, obj.b, obj.c)
}
1
2
3

And for classes.
import Console

class Fruit(type) {
fun summary(type) {
Console.out("I am a fruit of type " ++ type)
}

type = type
summary = expand(summary)
}

apple = Fruit("apple")
Console.out(apple.type)
Console.out(apple.summary())
apple
I am a fruit of type apple
rdococ
Scratcher
1000+ posts

Custom Programming Languages

__Falcon-Games__ wrote:

-snip-
Interesting… what does the ‘summary = expand(summary)’ line do?
ajskateboarder
Scratcher
1000+ posts

Custom Programming Languages

__Falcon-Games__ wrote:

So to create an object in Sandwich you don't need to create classes first, here's how you do it.
import Console

fun main() {
obj = Standard.Object(a=1, b=2, c=3)
Console.out(obj.a, obj.b, obj.c)
}
1
2
3
Reminds me a lot of JavaScript objects - very powerful feature - but not a very huge fan of the Standard.Object declaration. Seems a bit too verbose compared to using braces, yes?

rdococ wrote:

__Falcon-Games__ wrote:

-snip-
Interesting… what does the ‘summary = expand(summary)’ line do?
Yeah
TheSecondGilbert
Scratcher
100+ posts

Custom Programming Languages

__Falcon-Games__ wrote:

So to create an object in Sandwich you don't need to create classes first, here's how you do it.
import Console

fun main() {
obj = Standard.Object(a=1, b=2, c=3)
Console.out(obj.a, obj.b, obj.c)
}
1
2
3

And for classes.
import Console

class Fruit(type) {
fun summary(type) {
Console.out("I am a fruit of type " ++ type)
}

type = type
summary = expand(summary)
}

apple = Fruit("apple")
Console.out(apple.type)
Console.out(apple.summary())
apple
I am a fruit of type apple
Could this be a bit easier? (for example, calling `object` instead of `Standard.Object`)

Powered by DjangoBB