OSDev.org

The Place to Start for Operating System Developers
It is currently Mon May 06, 2024 4:09 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Thu Dec 14, 2006 6:28 am 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
OK, It is interesting, but I have still problems imagining how could you define stabndart c#/java -like model atop of your language along with other models but i believe it is possible. But it is certainly very interesting idea. It is task of creating a language that has ability to define as much models as possible while maintaining type safety. I should try to find something about it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 6:50 am 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
OK several other ideas came across my mind. How can u specifi thate something definition of object is stored in another object(or would this be hardcoded) and than implement safe reflection on top of it? Or would it have to bee hardcoded also? And even more complex task.Generics implementation by erasure? could it be implemented in such language? what term should i look for? HLA seems to be something slightly different.


Top
 Profile  
 
 Post subject: To ntfs
PostPosted: Thu Dec 14, 2006 8:40 am 
Offline
Member
Member
User avatar

Joined: Mon Dec 04, 2006 6:06 am
Posts: 158
Location: Berlin, Germany
ntfs wrote:
OK several other ideas came across my mind. How can u specifi thate something definition of object is stored in another object(or would this be hardcoded) and than implement safe reflection on top of it? Or would it have to bee hardcoded also? And even more complex task.Generics implementation by erasure? could it be implemented in such language? what term should i look for? HLA seems to be something slightly different.

I still need to figure out a lot of things. I'm not sure what you mean with "safe reflection", but reflection will be implemented. It will however be specific for a model I think, ie. the object-oriented. Emitting will also be supported. For safety you can use annotations, fx. to specify that an object field is private. How to store an object in another object? You just include a field, which is a pointer to the first object. Generics by erasure would be no problem. The compiler would perform the erasure and be using an object cast operator in the language and boxing operators (Integer vs. int). There is no such operators in any instruction, but they can be created in the language. And last but not least inheritance by inclusion could be used. But there is still some things about inheritance in the OO model I have to figure out, ie. how to do an "invoke virtual" for instance without having such instruction. Why not include such an instruction? Because it is specific to the OO model.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 9:11 am 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
1. I will explain the generic's thing on java example. When your java program compilation emmits no warnings it's type-safe and you do not need any casting operators(which are only runtime checks actually). Can this be implemented on top of your model?
2.I written the sentence
Quote:
How can u specifi thate something definition of object is stored in another object(or would this be hardcoded)
very badly. I mean that your system will store definition of type(struct,class...) in it's own way. And it will probably handle reflection also it's own way. Or will you allow the specific OO models to handle reflection and structure definitions by themeselves? I guess it would be very hard to proove compile-time correctness of theese algorithms.

Theese things decreases the flexibility of system. You really have to care not start creating system containing everything insted of system allowing everything(by specific models).

And to the virtual invoking....(i hope you mean VPTR stuff). Can not be VPTR an object of fields which contain pointers to methods? Just an idea.It would be usefull to allow method pointers anyway because many languages use them. For example you can make B extends A and thus VPTR(B) extends VPTR(A) and than you can call them with your model, can't you? Does it fit to your system?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 10:52 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 6:06 pm
Posts: 1437
Location: Vancouver, BC, Canada
ntfs wrote:
But the thing which I had not figured out is how they do the message passing... They say that they do it without copiing and I can't imagine any way doiing it without breaking heap integrity.


The key idea is that they use "tracking references" so that the compiler can statically determine when a block of exchange heap memory is no longer owned by a process (i.e. -- when it is sent over a channel or deallocated). Exchange heap memory is typed differently than other memory. This paper covers the implementation details of channels.

ntfs wrote:
GC would be only fall back for nasty applications. Applications would clean memory by combination of reference counting and explicit deallocation. Reference counting cannot handle circular references (eg A points to B, B points to A), but theese circles could be explicitly broken by aplication


With explicit deallocation, it's very difficult for the compiler to ensure that there are no problems with double deletion. What's the big problem with GC anyway?

ntfs wrote:
No closed processes - you can use final when you need and it has nearly the same effect and is more flexible


I thought closed processes were the thing that makes Singularity dependable. Moving away from them brings back a lot of problems, doesn't it? What do you mean by "final" exactly?

ntfs wrote:
I am currently in my system planning to have generics implementation by erasure, but additional system can be added(might be using class loaders) to the environment and this would allow mixins(in my opinion they are not very usefull anyway).


Mixins are extremely useful! Trying to design large-scale systems without them really sucks IMO. It tends to lead to all sorts of useless containment and delegation just to keep separate concerns apart. Have you heard of Scala? It makes mixins a very important part of the language, with some very interesting benefits.

_________________
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 10:57 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 6:06 pm
Posts: 1437
Location: Vancouver, BC, Canada
LOST wrote:
Is Bartok accessible for our use? And can we ask Microsoft to get it?


You can ask, but I don't think they'd give it to you, unfortunately.

Walling wrote:
But when I create my future OS I won't choose CIL as the language. I find it too restrictive. It is about programming paradigms and CIL is tightly bound to the single-inheritance object-oriented paradigm. What about multi-inheritance or mix-ins used in a lot of languages?


Have you looked at Parrot? I think the project might be dead now, but it sounds similar to what you describe.

Walling wrote:
They have to agree on some high level language, yes. This will be implemented in my language as a "paradigm model". You can create the object-oriented model, the procedure model, functional programming model, etc.


Not all languages are stuck in a single paradigm. :) Take a look at Scala.

Walling wrote:
But there is still some things about inheritance in the OO model I have to figure out, ie. how to do an "invoke virtual" for instance without having such instruction. Why not include such an instruction? Because it is specific to the OO model.


I disagree. "Invoke virtual" is just a special case of dynamic method dispatch, which is not really OO per se. Take a look at multimethods in Nice. Yes, it's an OO language, but multimethods don't really look OO...

_________________
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 11:46 am 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
OK, I've just found that paper before you replied:).
Quote:
With explicit deallocation, it's very difficult for the compiler to ensure that there are no problems with double deletion. What's the big problem with GC anyway?

As I said averything will be handled using reference counting which will make it safe. And the problem. It can be slow and it's mostly slow.
Quote:
I thought closed processes were the thing that makes Singularity dependable. Moving away from them brings back a lot of problems, doesn't it? What do you mean by "final" exactly?

At first I am slowly changingmy opinion. I was not decided to include Singularity messaging at time of my first post. That talked for tighter integration of component's , not to place them to different SIPs. And this included plugins. And I don't thing that SIPs can make lot of improvement. In the movie about Sing they gave an example of declaring some method static. You don't have to do it in Sing because it will detect it automatically. But indeed, it's not a big improvement i thing.
Quote:
Mixins are extremely useful! Trying to design large-scale systems without them really sucks IMO. It tends to lead to all sorts of useless containment and delegation just to keep separate concerns apart. Have you heard of Scala? It makes mixins a very important part of the language, with some very interesting benefits.

OK, i wrote only my personal opinion, i read only one pdf about them so i do not have much right to do any judgement.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 1:43 pm 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
I am quite confused about mixins. Maybe the things I heard are the same.
1.It is ability to use generic parameter as parent.
2.It is the scala's thing.
I'll try to work it out. That Scala pdf is hard tp understand at some points.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 11:07 am 
Offline
Member
Member

Joined: Sun Oct 24, 2004 11:00 pm
Posts: 46
Hi,

I find singularity's approach to an OS very interesting. What I most like about it is the abstractions for the applications. That way you can "hide" some complexities of the hardware and implement different protection methods for the processes.

As for the intermediate language to choose, I agree with Walling that it mustn't restrict the higher languages that it supports. Hence higher level virtual machines aren't efficient for a broad variety of paradigms. The easiest solution is a VM that resembles more the real system machine. Therefore VMs like Parrot and LLVM (low-level virtual machine) are better suited.

If I ever do an OS (I dream of it, but I decided to do first a high-level abstraction framework; something like a simple .NET), I would probably use my own language. I designed it as a proof-of-concept for a new paradigm: language oriented programming. Basicly the purpose is allow the code to modify the language syntax rules as it compiles (like metaprogramming). Therefore I can change to syntax (in-code) to become any other non-ambiguos language (I haven't thought about ambiguity yet). The theoretical problem I have encountered is for dynamic languages. The solution I'm aiming is to create static functions (ie. where possible decompose dynamic functions into static optimized functions) and maintain a generic very slow "identify type on runtime" function.

I like to discuss these wild theories =) I have some other posts on this forum about these wild theories from some time ago, but I think they didn't get any answers =(

Anyway, despite the digression, I hope I was helpful/useful. Thx,

JVFF


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 3:48 pm 
Offline
Member
Member
User avatar

Joined: Mon Dec 04, 2006 6:06 am
Posts: 158
Location: Berlin, Germany
Colonel Kernel, thanks for the dynamic multi-dispatch idea. I think I'll implement it in my language. Actually it solved some of my problems in the current design. Also Scala and Nice are exciting languages. Parrot – is it the Perl VM?

ntfs, thanks for your inputs. There are some things I haven't considered yet in my language design. Generics are easily supported. Reflection is however a more difficult subject. Severel security issues has to be considered. If an object field is tagged as private it might not be read or changed by the OO model, but maybe it could be read by another that doesn't interpret the private tag. And are you allowed to read your own code – benefits and drawbacks?

jvff, I agree with you. Your post is very interesting: language oriented programming. I'm not sure if it is something like Nemerle or it is at a deeper level? In Nemerle, I think, you still have to obey some fundamental rules. You can create very smart macros, but you can't design C++ inside Nemerle as an example. I also have to look at LLVM. They have an online compiler :D

After Christmas, I'd love to discuss such wild theories, because I have some myself. :) But now I have to spend some time with my family. Merry Christmas to all.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 4:16 pm 
Offline
Member
Member

Joined: Sun Oct 24, 2004 11:00 pm
Posts: 46
Yes, Parrot is supposed to be the Perl Virtual Machine.

The language prototype is way deeper than macros. It allows for example binary manipulation, so you could write an MP3 ID3 tag language syntax, that given input source code (an MP3) it outputs the title, artist, album, info etc. Why someone would do that is beyond me. It also might allow for someone to create a document converter.

In a concept level you can think of it's functionality as a multi-pass compiler compiler. Every pass generates some output and a compiler, which is feed with the output, resulting in another pass, until no compiler is generated or the generated compiler doesn't get executed (final pass).

Looking forward to discussing your ideas =)

JVFF


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 4:53 pm 
Offline
Member
Member
User avatar

Joined: Mon Dec 04, 2006 6:06 am
Posts: 158
Location: Berlin, Germany
I've actually thought about the binary manipulation idea, but it is very complicated I think. Maybe the n-level compiler can make it simpler, conceptionally. But you would somehow have to define a metalanguage to define other languages, if I understand you right. You are maybe able to change that metaprogramming while running the compilation. It is difficult to imagine what features it could give you, but it certainly would be interesting.

My ideas about the binary conversion thing was more like static compiling. You could define a lot of binary formats in the metalanguage, so applications wouldn't have to think about the parsing part anymore. An application opens a PNG file and gets a tree-structure containing the image metadata and content in easily readable rgb-format. You could then convert and store it as a GIF file instead using the GIF metalanguage. Just like the example with MP3 files getting an ID3 structure and wave data stream. Or your IDE calls some method to reformat your C++ code given your configured syntax properties. The C++ code has a specific syntax, but also some editable properties like where to insert and not insert spaces. The OS can also recognize your files this way and extract searchable metadata. It is like an abstraction level for languages and file content. Your idea however seems to be even more fundamental.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 23, 2006 11:09 am 
Offline
Member
Member

Joined: Sun Oct 24, 2004 11:00 pm
Posts: 46
In the way I implemented, at the lowest level inside the metalanguage compiler, all you need to do is modify the syntax tree stored in the compiler. Each syntax tree node has some code that after parsing, is placed on the resulting parsed tree node. And then the parsed tree is executed.

But then I derived a Parsing Expression Grammar inspired language that is hard coded into the compiler. This is just to get the concept working, because I could just execute code inside "modify" blocks, and from then I could write a metalanguage metalanguage (a language expressed in syntax modifications to better express syntax modifications).

I currently have the compiler working, but I'm generating some test metalanguages. Currently I'm writing a metalanguage for x86 assembler (in a stripped form, macros, includes, segments, and memory types (db, dw, dd, float, string) are not implemented, and are supposed to be at another pass. The idea is to have just a basic language that assembles instructions and data blocks containing hex-expressed bytes. Therefore a language on top of it would be implemented to express output formats (ELF, a.out, etc.) and the real syntax availabe to the user (like Intel syntax, AT&T, nasm compatible, etc.).

I hope it allows more compatibility between languages, more expressivity to the programmer, and more productivity for language prototyping.

I have been wondering if it would be possible to have reverse metalanguages, which define output. That means it is a language to define output formating based on a syntax. However it would be interesting to use the own metalanguage as a reverse metalanguage, meaning given two syntaxes that output to the same syntax, you can convert between them.

JVFF


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 24, 2006 9:05 am 
Offline

Joined: Tue Dec 12, 2006 9:55 am
Posts: 19
Location: Czech Republic Prague
Hm.... interesting ideas.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 3:31 am 
Offline
User avatar

Joined: Thu Dec 14, 2006 4:08 am
Posts: 5
I think it's not really good idea to invent a bicycle :) I don't think I can invent my own beautiful language or executing machine. Besides, it would be incompatible to the most widespread APIs. So, IMHO, we should implement one of existing frameworks and .NET seems to be the most perspective of them now.

Therefore I started implementing CLI. If I'm lucky I would done it one day :wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Amazonbot [bot], Bing [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group