• entries
743
1924
• views
580977

# Erm

224 views

Right, so yes, clearly been a bit out of control recently but it's all good. Never mind, move on, let's get back to programming.

Until I've moved properly and got my PC back, I'm stuck working on this tiny fucking Aspire thing with an Intel Atom. It's a good little bugger and I love it but it can't really do much in the way of graphics.

So I've become interested, purely as an intellectual exercise, in a completely dynamically typed language. Yes, there are probably loads, no, I don't expect anyone to write serious code in it, yes, mine is probably shitter than everyone elses.

That out of the way, so far I have the following source and a compiler that can parse it into a symbol tree:

class test{	class vector	{		var a,b,c;		var d;			push_back(a,b,c)		{		}	}	class list	{		class node		{			var x,y,z;		}	}		class float	{	}}

This generates the following symbol tree dump:

class testclass test.vectorvar test.vector.avar test.vector.bvar test.vector.cvar test.vector.dmethod test.vector.push_back(a,b,c)class test.listclass test.list.nodevar test.list.node.xvar test.list.node.yvar test.list.node.zclass test.float

Yes, early days but it's a start.

The idea is that vars will carry their type around with them and all operations will be checked at runtime. All good fun.

Started thinking about whether I needed to differentiate between call by ref or call by val and head started hurting so gave up and decided to share my latest stupid project here with the only other people in the world who might understand why I would undertake such a pointless exercise.

Looks interesting. [smile] Is this going to be interpreted or compiled? Do you have a projected use for it (e.g. using it as the scripting language in one of your games) or is it purely for fun?

Quote:
 Original post by benryves Looks interesting. [smile] Is this going to be interpreted or compiled? Do you have a projected use for it (e.g. using it as the scripting language in one of your games) or is it purely for fun?

Compiled into bytecode for a VM is the current plan. To be honest, I can't really see me using it in games because the overheads are going to be really high.

Every method call is going to involve indexing into some kind of database based on the current type, doing string comparisons to find out if the method is valid etc etc.

This is really just exploring an interest. Bit like your mad scientist electronics I guess, although mine is less likely to rebel against its human master and take over the world.

## Create an account

Register a new account