HGL - a graphics language

Pages: 12
closed account (D4S8vCM9)
I refactored the assignment operator. The first implementation was everything than clever, saving in the compiled binary a reference and a serial id of the type only. Next the binary parser had to collect the next type from the input stream and assign it to the variable.

The new assignment operator can handle arbitrary complex expressions including references. The compiler parses and evaluates out all scalar types line floats, ints and vectors and now leaves a prepared RPN stack for evaluation on runtime in the interpreter.

So, this stack is now more than just the object the old implementation hold. Therefore it doesn't need this references anymore, because the compiler takes care in the stream the full RPN stack or even only the single scalar object are next to the variable to assign, the interpreter just needs to know, that the next tokens are to assign.

Short: the reference and the serial id of the "to assign" type can get removed out of the compiled binary.
I can let them in too and ignore them, but that way the binary will blow more and more, and this I want to avaoid before version 1.0.
closed account (D4S8vCM9)
Just a small update to keep the thread alive.

I just finished with the assignment operator. Now following is possible for the 4 basic arithmetics and for points, vectors and float values:

// ...
procedures {
	proc moveAPolygonLineED {
		[ offset ] // expected parameter(s); only one here
		{} // constructor (empty, but required)

		// add and assign 'offset' parameter to @aPolygon.d.p2
		@aPolygon.d.p2 = #aPolygon.d.p2 + #offset;
// ...
main {
	// call the procedure defined above with a vector, to move y-coord down
	@moveAPolygonLineED((0, 90 + 10));
	render(); // finally render the picture

The rest is almost the same like in the example I posted before. I just changed aPolygon.d.p2 to -54.

The next release will be after I implemented expressions like that:
@aPolygon.d.p2 = (#aPolygon.d.p2 + (1 + 2 * 10) + -sin(#offset)) * sin(7+83) + (#aPolygon.d.p1);
as well as implementing all operators for all object types.

EDIT: while the above code works very well, there is a problem left with operator precedence, i.e. @aPolygon.d.p2 = #aPolygon.d.p2 + #offset * 5; causes problems. I get the right RPN order from the compiler, but I have an error evaluating it in the interpreter :-/
Last edited on
closed account (D4S8vCM9)
New Version 0.4.20 released: http://www.cplusplus.com/forum/lounge/91447/#msg491507

This release contains - except a lot of bugfixes - a feature versioning system, i.e. the compiler notes the minimum required version of the interpreter in the HGLZ binary and also displays it on the console.

The interpreter itself can now reject HGLZ binaries which contains features incompatible with it.
It is also possible to produce HGLZ binaries with a recent compiler, which can be executed with an older version.

In the future I'll implement a switch too, where the user can set the minimum target and the compiler will show if and which features are incompatible and cannot be used on the target interpreter version.

But for now, I will continue working on expression evaluation (assignments and friends).

Plugin developer information can be found here: http://rangun.de/hgl-plugin-devel-doc/
Last edited on
closed account (D4S8vCM9)
This post is just to keep HGL in mind. Please don't accuse me of blogging.

I'm quite near to publish soon version 0.4.50, which will have - aside of tons of bugfixes - some remarkable new features:

* complete support for references in expressions
* callback procedure support for render, for i.e. give information to GUIs on the rendering process
* target selection for checking for compatibility and also to generate compatible binaries to older versions of the interpreter
* binaries are in general a bit smaller, but this will be only noticeable on large projects

An own web page is in progress on http://www.hgl.rangun.de
closed account (D4S8vCM9)
A basic web page for HGL is set up now: http://www.hgl.rangun.de

It consists of Downloads (of course), a news section and a blog.
Currently there is not that much content, but expect to grow it soon!
It consists of Downloads (of course), a news section and a blog.

Great. Can one assume then, that you will finally drop the thread dedicated to advertising your personal project here? =P
The website is down, so I'm guessing...no :(
closed account (D4S8vCM9)
Hm, why drop?

I must take out some posts before, even if I see no reason not the let it be archived by C++.com.

But I'll close it.

@LB: no it is NOT down! => http://hgl.rangun.de/

Why the sad smiley? Is my project sop horrible that is must vanish out of this world? I assume all your projects are better. And one additional NOTE: it has STARTED as personal project, it is NO more a personal project!
Last edited on
c:\Users\Sean\Downloads\hgl-0.4.20\hgl>hgl example.hgl
ERROR: found corrupted input.
Hm, why drop?

By 'drop' I meant cease updating/bumping the thread in order to (in your own words) "keep HGL in mind" which is, IMO, advertising. While I'm not averse to the occasional "Hey check out my XXX," the updates are out of place here and maintaining a thread for the sole purpose of advertising your project seems a bit excessive.

Of course, this opinion is entirely my own. Others are sure to differ.

I assume all your projects are better.

I don't feel the need to maintain a thread devoted to any of my projects here.
@Velnias we just don't want development threads like spoonlicker's "new child language"
closed account (D4S8vCM9)
c:\Users\Sean\Downloads\hgl-0.4.20\hgl>hglc -o example.hglz example.hgl

The hgl-file has to get compiled first, this is done by hglc.exe, next step is to let it go through the interpreter:

c:\Users\Sean\Downloads\hgl-0.4.20\hgl>hgl example.hglz -O png -o example.png

Since the Windows build is just an emergency build (for the moment), because of my main testers hardware failure on her Linux box, I have no readme.txt in it. Put the next release will have it :-D
closed account (D4S8vCM9)
@LB: "new child language" ?? I'm neither spoonlicker nor a native speaker of English.

Finally an announcement of the Linux (Ubuntu Precise i386) version: 0.4.46 is out.
Last edited on
"New child language" http://www.cplusplus.com/forum/lounge/85713/
It has nothing to do with spoken languages like English.
Last edited on
closed account (D4S8vCM9)
@LB: ok, I understand.

Difference is, I openly stated I want feedback on my project, because in my "friends" circle, nobody was willing to cooperate, because it was too "technical", too much mathematics and algorithms... They just have been unconvincable that it is a product like firefox or similar (from the view of software in general).

I blogged about my project on Facebook, and as you may now "reflection" on the current work is often the best way to go further in development. But since even Facebook was the wrong way I put the blog on the HGL page too.

Maybe a bit too prominent on top of the navigation and I should take blog posts out of the start page, but I will continue blogging and I will do it only on my page now.

EDIT: I'n not that kind of beginner, that writing a "language" itself is the sensation for me, but I want a specialized language for achieving the flexibility I aim in my project.
Last edited on
closed account (D4S8vCM9)
No, not blogging, no announcement for HGL, but an invitation for developers to develop images for the HGL showcase:

Topic archived. No new replies allowed.
Pages: 12