#Custom Level Language Discussion

133 messages ยท Page 1 of 1 (latest)

honest gazelle
#

For discussion of the language used for custom levels

bleak orchid
#

what do you want to know? ๐Ÿ™‚

honest gazelle
#

mostly just what inspired it

#

is it a completely new language or based off an existing one

bleak orchid
#

well its based on my own ideas, but I try not to be different if there isn't a good reason for it

honest gazelle
#

makes sense

bleak orchid
#

however, I am still building it as if it would become its own standalone thing

#

So no compromises ๐Ÿ™‚

honest gazelle
#

what do you plan on naming it then?

bleak orchid
#

I think I will name it wrench

honest gazelle
#

oh nice

#

only slightly better than "Yet Another Generic Brace Language"

bleak orchid
#

lol

honest gazelle
#

I am wondering how the actual level creation will work? is it similar to zachtronics or different

bleak orchid
#

Wrench is because its a simple unassuming, but reliable tool

bleak orchid
honest gazelle
#

ah

bleak orchid
#

Here is what the current level language looks like

#

this one is very simple and not compiled

#

its interpreted, which is kind of a hack

honest gazelle
#

what's going on with the random numbers at the top? shouldn't out be based on in?

#

actually for context, (if this is an ingame level) which level is this?

bleak orchid
#

this is for the bus level

honest gazelle
#

ah that makes a lot more sense lol

bleak orchid
#

in decides which input to read from and out which output you send to

honest gazelle
#

and val1 and val2 are the 2 byte inputs

bleak orchid
#

yeah

honest gazelle
#

nice

bleak orchid
#

so you will basically write a couple of functions like this to create a custom level

honest gazelle
#

it actually seems pretty similar to zachtronics

bleak orchid
#

there also needs to be a way to design the starting layout of the level and a few other things like that

honest gazelle
#

at least TIS and shenzhen

bleak orchid
#

I see

honest gazelle
#

since (and it's been a while since I've made a level in them) you generated an input, and then put that through some algorithm you made in lua to get the output

#

I might be wrong though

honest gazelle
#

or was the one in #general the previous version

bleak orchid
#

which I am going to replace

honest gazelle
#

ah

bleak orchid
#

Maybe the syntax looks a bit similar, but they work very differently

#

the one that is in the game right now took 1 or 2 weeks to make or something like that

honest gazelle
#

from what I understand about the new one (which might be incorrect but hopefully it isn't) it looks pretty cool

bleak orchid
#

thanks ๐Ÿ™‚

honest gazelle
#

I'm not really an expert at high level languages, only asm

#

which, kind of a missed opportunity to program the custom levels using an ingame computer lol

#

anyways gl on the language

bleak orchid
#

thanks!

#

I am trying to get generics to pass the tests right now

honest gazelle
#

do you mean generically typed methods or generic tests?

bleak orchid
#

Here is an example of a generic function

#

normally you use name types T for some reason

honest gazelle
#

T I assume is short for Type

bleak orchid
#

here generic types are just named starting with $

honest gazelle
#

in c# at least generically typed methods are usually done with angle brackets T my_func<T>(T n)

bleak orchid
#

yeah

honest gazelle
#

from the image in general I assume angle brackets are for arrays/lists?

bleak orchid
#

no they are only for enums actually

#

I want to allow inline enum declarations

honest gazelle
#

oh nice

#

though not very helpful for me since I only recall using an enum once lol

bleak orchid
#

so you struct could be something like this:
{ operating_system :<windows, linux, macos> whateever :int }

honest gazelle
#

don't you have to also assign those values?

bleak orchid
#

above would be a type definition

#

But actually, you are right in type definitions you actually give the default value, not a type

#

The way you specify a value of some type is like this :int

#

For example:
var my_number :int
or
var my_number :int 4

#

But you can use it anywhere since its actually part of the value

honest gazelle
#

do you mean type of a variable?

bleak orchid
#

yeah for example if you want to make an array of u8 you could do this:
[:u8 1, 2, 3, 4]

honest gazelle
#

from how I interpret it var num :int would imply an integer named num

#

ok

bleak orchid
#

because the first item is u8, it figures it out

#

you could also do this :[u8] [1,2,3,4]

honest gazelle
bleak orchid
#

No they are enum identifiers

honest gazelle
#

ok

bleak orchid
#

kind of like variables where windows is equal to 0 etc

honest gazelle
#

ah

#

so they default to 0,1,2,etc.

bleak orchid
#

yes

honest gazelle
#

so operating_system.windows == 0

bleak orchid
#

no, you actually have to convert it to an int like this: ord(windows) == 0

#

but the ord() thing isn't done yet

honest gazelle
#

ord = ordinal?

bleak orchid
#

I think I will actually just let you do it like this :u8 windows == 0

honest gazelle
#

yeah casting makes more sense

#

(at least I think that's considered casting)

bleak orchid
#

sure

#

actually I am making chars just enums

#

like 'a', 'b', 'c'

honest gazelle
#

will there be an ingame ide for it (hopefully better than the ingame assembler) or will it need to be made outside the game?

honest gazelle
bleak orchid
#

so strings are just a named type of an array of this enum

#

yeah

honest gazelle
#

when it gets interpreted you should be able to just treat 'a' as 42(?).

bleak orchid
#

no you would need to cast

honest gazelle
#

I mean in the asm

#

since the processor doesn't distinguish between an int and a char

bleak orchid
#

yeah

#

after type checking, types don't really matter anymore

honest gazelle
#

except array types

#

and pointers

#

and def floats

bleak orchid
#

pointers are also just ints

honest gazelle
#

oh right

bleak orchid
#

but floats are different in hardware

honest gazelle
#

is there even a different type for pointers in HLLs

bleak orchid
#

but your hardware doesn't keep track of what is typed or untyped, and most operations are the same anyway

bleak orchid
honest gazelle
#

ah

bleak orchid
#

they may give you references which are kind of safer pointers

honest gazelle
#

also slightly curious, will the language be interpreted directly to machine code or to another language like LEG or C++?

bleak orchid
#

directly machine code

honest gazelle
#

ah

bleak orchid
#

I want it to be as fast as possible

#

actually I am going to make your circuits also convert to this language (well not to the text but to some later step in the compilation)

#

which means level code and your circuit will melt together and be converted to binary and run fast

honest gazelle
#

nice, in that case I'd recommend making it compiled (if possible) since compilation is faster than interpretation, though it may result in a lag spike when hitting the "run fast" button

#

though I can also see why you wouldn't since I would assume (again I've never written a compiler/interpreter) that compilation would be harder than interpretation

bleak orchid
#

this is a compiler

honest gazelle
#

wait what

bleak orchid
#

and yes it is 100x harder

#

especially if you optimize as well, which I also did

honest gazelle
#

oh nvm interpretation was for the current language lol

bleak orchid
#

I mean I didn't do all the optimizations, but I was curious to find out how it all works ๐Ÿ™‚

honest gazelle
#

I mean if you were rich you could hire millions of people to manually compile it with perfect optimizations

bleak orchid
#

it has to compile every time you change your circuit

honest gazelle
#

oh

#

nvm then

bleak orchid
#

ok anyway, better get back to work

honest gazelle
#

I'd say only make it recompile when you run the circuit

#

but yeah I'll let you work now