Author Topic: Started?  (Read 15269 times)

0 Members and 1 Guest are viewing this topic.

efgee

  • Full Member
  • ***
  • Posts: 172
Started?
« on: August 16, 2012, 12:28:38 PM »
Charles,
did you already start on this?

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4267
    • Oxygen Basic
Re: Started?
« Reply #1 on: August 16, 2012, 01:39:08 PM »
Yes, I have made a tentative start, I can produce a naive version quite easily, but some Oxygen constructs have no counterparts in C.

Charles

John

  • Hero Member
  • *****
  • Posts: 3639
Re: Started?
« Reply #2 on: August 16, 2012, 02:33:20 PM »
There is a point were cool loses to portability. I'm confident your will find the answer.

efgee

  • Full Member
  • ***
  • Posts: 172
Re: Started?
« Reply #3 on: August 16, 2012, 02:53:59 PM »
Understood.

If the problem is on the oop side of things:

Here is a nice pdf file explaining how to oop in c: www.cs.rit.edu/~ats/books/ooc.pdf

Then there are some libraries that help with it:
http://sourceforge.net/projects/cos
http://sourceforge.net/projects/ooc-coding
http://sourceforge.net/projects/sooc/
http://sourceforge.net/projects/oooac
http://sourceforge.net/projects/lwoopc/
https://code.google.com/p/ooc-gcc/

Don't know if they are any good as I've only worked with one of them in the past (an older version of cos).

EDIT:
found another one:
http://code.google.com/p/cluscore/
« Last Edit: August 16, 2012, 03:13:13 PM by efgee »

efgee

  • Full Member
  • ***
  • Posts: 172
Re: Started?
« Reply #4 on: August 16, 2012, 03:09:03 PM »
There is a point were cool loses to portability. I'm confident your will find the answer.

   ;D
.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4267
    • Oxygen Basic
Re: Started?
« Reply #5 on: August 16, 2012, 03:23:19 PM »
OOP isn't a problem, it is local macros, nested functions and run-time compiling.

efgee

  • Full Member
  • ***
  • Posts: 172
Re: Started?
« Reply #6 on: August 16, 2012, 03:41:11 PM »
Didn't you get the memo?
Macros are evil  :P


efgee

  • Full Member
  • ***
  • Posts: 172
Re: Started?
« Reply #7 on: August 16, 2012, 03:51:05 PM »
Nested functions could be created with a goto inside the function could they not?
(at the end of the parent function after a function return)
The name of a label should be created with both function names -> parent and nested functions.

It sounds too easy, I'm surely missing something...

John

  • Hero Member
  • *****
  • Posts: 3639
Re: Started?
« Reply #8 on: August 16, 2012, 04:34:05 PM »
Didn't you get the memo?
Macros are evil  :P

If that is the case, ScriptBasic is the Devil in the flesh.

The SB extension module interface is almost exclusively macros. I never considered macros a porting issue since SB pretty much runs on everything.

I know this might sound crazy but isn't the goal here to create a text file that C will compile? With enough C code, anything can be emulated. Don't forget about all the existing libraries that are there to make your life simple. Charles, I don't think anyone is asking you to compromise the O2 code for an emulation that runs outside the box.
« Last Edit: August 16, 2012, 04:51:07 PM by JRS »

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4267
    • Oxygen Basic
Re: Started?
« Reply #9 on: August 16, 2012, 09:18:17 PM »
Yes you can do almost anything with C, and most of Oxygen's special features can be emulated by using extended labels and symbols in the global namespace. It just requires extra work.

John

  • Hero Member
  • *****
  • Posts: 3639
Re: Started?
« Reply #10 on: August 16, 2012, 09:47:59 PM »
I want to make sure we are all on the same page with this effort. The C emitter is a convenience feature of O2 while you continue to develop and port your JIT compiler. Anything more is going in the wrong direction. IMHO

Just to keep the separation of state intact, we should write the O2 Basic to C converter in SB so more folks can contribute. I have already started thinking about the fun I'm going to have writing a SB extension module to cover the areas best done as a C wrapper.
« Last Edit: August 16, 2012, 10:02:50 PM by JRS »

Aurel

  • Guest
Re: Started?
« Reply #11 on: August 16, 2012, 10:06:15 PM »
Quote
we should write the O2 Basic to C converter in SB so more folks can contribute.

This is the dumbest thing I've ever heard.
And where are those folks...?
Who will write this ...you John.
Oxygen syntax is far better then this that's for sure.
But because i am not interested i will shut up... :-X

John

  • Hero Member
  • *****
  • Posts: 3639
Re: Started?
« Reply #12 on: August 16, 2012, 10:21:49 PM »
Aurel,

Go take your meds and chill out. You are acting like a spoiled brat again.


Aurel

  • Guest
Re: Started?
« Reply #13 on: August 16, 2012, 10:34:13 PM »
Why insult ;D
I just say what i think of your idea where everything started with SB.
James have more expirence then anyone in translators(BCX),right...
Beep ...i use my pill... ;D

John

  • Hero Member
  • *****
  • Posts: 3639
Re: Started?
« Reply #14 on: August 16, 2012, 11:11:19 PM »
Okay, I'll ignore for now you calling me stupid and then ranting about things you know nothing about.

Why I suggested ScriptBasic.

  • Charles is intimate with the internals
  • It runs on all popular platforms including Android.
  • ALL scripts and extension modules play the same tune.
  • It would make a good tutorial on compiler design at a level us mortals understand.

I was proud of you turning your act around and finding meaning with your work. Please allow others to enjoy their efforts and contributions.