User loginNavigation |
Languages and data conversions.Hi, This is my first post to these forums, so I'm not sure its exactly the best place. If anyone can suggest a better places for the topic then I'd be very interested in hearing them. Also, I'm not sure exactly on the latest terminology so I'll explain in a bit more detail to start of what I'm attempting to do. Ok, that's the disclaimers out of the way. I am currently designing a new programming language that is based on a non-text based representation. That is, you will need a more complex editor than just a text editor to modify the code. The programmer will be editing the AST directly. The aim of this programming language will be that everything will be stored & communicated in the same format. That includes language, the byte code, the data, etc. The language will be Object oriented with a lisp feel (closures, etc). I know the idea of developing a programming language that is non-text based is not original. Does anyone know of any university or other projects that have developed this type of system? The real reason for this post is that I'm interested in how this type of programming will change the semantics and basic structure of the language. An important aspect of this language will be modifying objects to become data, making objects from data, transforming data and executing data (ie transforming data to a series of instructions). I'll show a few examples to explain what I'm talking about. Objects to/from data I'll explain using a simple made up class. class Foo { int getX() The Foo class will need to be transfered in communications, written to file etc. However, a lot of the time what is transfered is different from the data format. Lets say I have two formats: Data FooData: { u32["x"], u8ascii["str"], BarData["b"] }; The first data FooData has all three bits of data transfered and the second one doesn't include the bar data. One idea I've had is to create a first class function called a "cast" which allows the programmer to write a function to perform any conversions to other data structures. Cast FooData(Foo f) Cast BasicFooData(Foo f) And from data to Foo: Cast Foo(FooData fd) Obviously, I'm not too worried about syntax at the moment. I'm just looking for some good constructs to help the programmer out. From a java point of view these type of conversions are So, what do people think of this as an addition to a language? Is this handled in other ways in other languages? I've got some other ideas I'd like to discuss, but I'll see how this goes down first. :) Thanks, By David Ryan at 2008-02-03 23:25 | LtU Forum | previous forum topic | next forum topic | other blogs | 8401 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago