Simplistic yet flexible

I was thinking of developing a very basic language that supports lwjgl. The main idea behind it would be that you can easily create a fairly complex project with very little code , especially for the graphics . So setting up a VBO in lwjgl is a long process require a lot of code with hundreds of different functions that you can use , to create a vbo in this language it could simply be Vbo i = Vbo.create(verticies,texture). It would also include basic input functions and also direct display handling that allow you to perform tasks such as a tick delay with one line of code. All vbos can be bound to this buffer with Vbo.assign(). and remove with Vbo.remove(). , note that the . is the equivelant of ;. Another feature I was thinking of implementing direct shader writing . So here is an example of what the syntax for it may look like.


(Name = "Example")...//Declare new functions and classes through brackets
	Vbo object;
	(init_{})...//parameters are stored within {} and indentation is done through ...
		print{"This is an example"};//end the function call with a ;
		load{};
	...
	(load{})...
		Display.create{800,600,"Example"};
		Display.starttick{60};
		?<!object>... //an if statement
				object = Vbo.create{v2d.list{0,0,1,1,1,0,0,1},Texture.load{"Test.png"}};//no creating objects simply function calls that return them
		...	
		Vbo.assign{object};
		Vbo.translate{object,60,60};
		Vbo.update{object};
		Vbo.createshader{shader-s};//write the shader directly into your code
		Vbo.bindshader{shader-s};//built in error checking confirms wether it has been loaded in
	...
	(Shader = shader-s)...//very simple shader built directly into the code, this is the default shader that would be used if none were loaded
	attribute vec2 vectex;
	uniform vec2 transform;
	uniform float scalar;
	varying vec2 vecdata;
	void main()
	{
		vec4 offset = vec4(position.x+transform.x,(position.y+transform.y),1,1);
		gl_Position = offset;
		vecdata = vectex;
	}	
	...
...

That code would gladly render a vbo to the screen with the set texture , what do you think?

Why a whole language? This is doable as an API.

Because creating a language is more difficult than creating an API and it would challenge me. Thats the main reason.

I mean sure, if that’s the goal, just realize libGDX is pretty much already what you want.

http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/VertexBufferObject.html
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShaderProgram.html

Not to mention the even higher level abstractions over those such as Meshes, etc.

Using < and > for parameters, makes designing unambiguous syntax for number comparison really difficult…

If you think you can do it, and want to, go for it :slight_smile:
It would definitely be an interesting project.

I have some issues with the actual language though, sorry.
I dont want to be cynical, or put down a project that is still in its conceptual stage, but some critisism might make benifit the project.

The language is really verbose, and it is not obvious at all how the dot method/object annotation works.
You shouldnt replace the semi-colon with dots. Its going to make the project less appealing to people that are used to the semi-colon, which is almost everyone.
And if you do replace the semicolon with dots, dont also use the dots to access object members, its really confusing.
The fact that you have to put in a comment the code that was an if-statement should tell you something is wrong with the conditional syntax, sorry.

Looking at the way you’ve structured your supposed language, you might like play-clj, a clojure wrapper for libGDX, looks like this:

Create a texture and size + rotate it


(assoc (texture "Clojure-icon.gif")
    :x 50 :y 50 :width 100 :height 100
    :angle 45 :origin-x 0 :origin-y 0)

Handle simply key input:

:on-key-down
    (fn [screen entities]
        (cond
            (= (:key screen) (key-code :dpad-up))
            (println "up")
            (= (:key screen) (key-code :dpad-down))
            (println "down")
            (= (:key screen) (key-code :dpad-right))
            (println "right")
            (= (:key screen) (key-code :dpad-left))
            (println "left")))

More here and here

Yer I can see what you mean however most of that can be handled post designed due to the way im making the compiler , so it runs through each line and it splits up the strings based on the given syntax to give definitions and function blocks which is then all written to the compiled file and run through the javac. Its more of an overlay language than an entirely new language.
I have changed a few things , semicolons are back , and no more alligators for the parameters (if you get this you had a fun maths teacher). I dont know about the ? I like it.