Jump to content
  • entries
    743
  • comments
    1924
  • views
    583669

Erm

Sign in to follow this  
Aardvajk

285 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 test
class test.vector
var test.vector.a
var test.vector.b
var test.vector.c
var test.vector.d
method test.vector.push_back(a,b,c)
class test.list
class test.list.node
var test.list.node.x
var test.list.node.y
var test.list.node.z
class 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.
Sign in to follow this  


2 Comments


Recommended Comments

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?

Share this comment


Link to comment
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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!