Oxygen Basic

Information => Latest Version => Topic started by: John on October 07, 2018, 02:25:40 PM

Title: Self Compiling
Post by: John on October 07, 2018, 02:25:40 PM
Charles,

When are you estimating a release of the self compiling branch?
Title: Re: Self Compiling
Post by: Charles Pegge on October 08, 2018, 03:37:45 AM
Hi John,

I'm working on the features we were discussing with Josť on automatic destructors and transient objects. I think that with other intervening tasks, it will take about 4 weeks. But if anyone wants to try o2 in its current state, I can provide an update.
Title: Re: Self Compiling
Post by: John on October 08, 2018, 10:55:23 AM
If I can get GitLab CS running on the server as a sandbox repository, we can create two O2 branches and move Jose's docs over. Until then, no use making any changes or giving you extra work.
Title: Re: Self Compiling
Post by: Josť Roca on October 08, 2018, 12:34:02 PM
It would also be needed that the compiler will be able to work with UTF-16 source files. Otherwise, working with unicode and not being able to use unicode string literals will be so hard that nobody that works with unicode will use it. Of course, an editor able to work with unicode will also be needed.

The provided include files that contain wrapper functions are also useless to work with unicode since all of them are ansi.
Title: Re: Self Compiling
Post by: Charles Pegge on October 08, 2018, 12:50:48 PM

I have made provision for reading UTF-16 source code. It is reduced to UTF-8 before compiling. What I need to do is to conserve unicode string literals.
Title: Re: Self Compiling
Post by: Aurel on October 08, 2018, 10:11:00 PM
First of all to have unicode i not crucial for compiler
and i don't understand Jose obsession with with this .
Personally i don't need and don't care about this unicode things i prefer ANSI.

Chales
Constructor /destructor ...why this must be same as in FB ?or any other compiler
personaly i don't do very much OOP but current way is unique and really the easiest in
programming world....so Charles is that still valid or be changed? 
Title: Re: Self Compiling
Post by: John on October 08, 2018, 10:38:20 PM
Aurel,

You would be much happier being part of the save VB6 crowd. I get it you're happy with traditional Win32 programming. Charles is taking BASIC to new levels.
Title: Re: Self Compiling
Post by: Aurel on October 08, 2018, 10:45:56 PM
John

 keep your opinion for yourself...  >:(
I am asking Charles and not you!
So i will stay with 043 because all that changes just cause bugs or quirks
and almost every time somethings not work properly.
win32 is still valid in Windows world...so swallow that fact ?

Or maybe i am not welcome here?
I and Arnold are probably only real Oxygen Basic users and as such i have a
right to know what will be .
Title: Re: Self Compiling
Post by: Charles Pegge on October 09, 2018, 04:25:58 AM
Hi Aurel,

The class system will remain compatible, with optional constructors and destructors. The difference will be that destructors will be invoked automatically when objects containing them are reconstructed or go out of scope.
Title: Re: Self Compiling
Post by: Arnold on October 24, 2018, 11:55:27 PM
Hi Charles,

I noticed that you provided an oxygen.dll with your recent upload to Github. Could this dll already be used to experiment a little bit or would it be better to wait until the next release of Oxygenbasic?

Roland
Title: Re: Self Compiling
Post by: Charles Pegge on October 25, 2018, 07:26:20 PM
Hi Roland,

the OXSC series of folders are self-compile backups (these folders belong in the inc folder). I'm weaving in some very intricate code for Josť, so it might be a little early to experiment with them.

Title: Re: Self Compiling
Post by: John on October 25, 2018, 10:48:33 PM
Any chance you can post a summary of the changes and additions to come? A small example would also be helpful.
Title: Re: Self Compiling
Post by: Charles Pegge on October 26, 2018, 04:12:30 AM
Hi John,

This is my recent log:
Quote
11:35 26/10/2018 Support object operators
11:15 26/10/2018 Support extended 'with' syntax '..' (wths)
11:14 26/10/2018 Fix namespace names containing '::' (reco.bas instrevn)
11:21 26/10/2018 Support named enumeration dot members (enums)
11:10 26/10/2018 Trap attempted assignment to non-variables (not a variable)
11:10 26/10/2018 Fix higher types retval / retvar as pointer (typp)
11:09 26/10/2018 Support deferred destructors (epif)
11:09 26/10/2018 Fix lost arrays in types (tran.inc -8)
11:07 26/10/2018 Trap undefined types in C-style prototype (ert=406)
11:00 26/10/2018 Support wide string literals L"..." (utfs)
10:59 26/10/2018 Support UTF-8 and UTF-16 big-endian / little-endian (bom)
10:59 26/10/2018 Fix 64bit right() and mid() with negative offsets (RTL32 & RTL64 mids)
10:59 26/10/2018 Self-compiling 0.1.0 (7 Oct 2018) (final FB 6 Oct 2018)
11:05 20/10/2018 convert if block to case block (enco.bas sizeofregs)
11:01 20/10/2018 Fix integer comparator (expr.bas comparister)

08:44 20/10/2018 Rollback \inc\o2 to 06/10/2018

and here is my test piece for object operations:

Code: [Select]
'objects in expressions
uses ..\rtlobjects
class cc
  bstring b
  method constructor(cc*v) {b=v : print "cc in " b}
  method constructor(int v) {b=v : print "int " b}
  method constructor(float v) {b=v : print "float " b}
  method constructor(string v) {b=v : print "string " b}
  method destructor(){print "cc destructor" : frees b}
  'OPERATORS:
  operator load (string*s){s=b} 'requires perfect match
  operator load (cc*a){print "cc load" : a.b=b}
  operator + (cc*a) {print "cc +" : a.b+=b}
end class
'#recordof cc

function foo(string a) as cc {print "foo cc" : return.b=a}

'TESTS:
=======
'
cc a,b,c
'a=b
'a=b+c
'a=foo("helo ")+foo("world")
a=b+("hello "+"world") 'not working yet
print a.b
Title: Re: Self Compiling
Post by: John on October 26, 2018, 06:12:27 AM
Thanks Charles!
Title: Re: Self Compiling
Post by: John on October 27, 2018, 01:52:08 PM
Quote from: Charles@JRS
taken by the gulls

Hate when that happens.  :)
Title: Re: Self Compiling
Post by: John on October 29, 2018, 06:46:10 PM
Charles,

Is what you have for the next release on Github usable?

It would be great if Josť had something to experiment with.
Title: Re: Self Compiling
Post by: Charles Pegge on October 29, 2018, 08:39:46 PM

Hi John,

Most of the new (object) features are now working but require thorough testing, and a few extra error-traps.
Title: Re: Self Compiling
Post by: John on October 29, 2018, 09:20:07 PM
Sounds like you're getting close to an official release.

Title: Re: Self Compiling
Post by: Arnold on November 14, 2018, 01:47:30 AM
Hi Charles,

I have read the Oxylog.txt file in your latest OXSC18.zip. That looks really impressive. You have obviously added many important modifications in the last four months.

If some of my previously posted code should not be compatible with your changes, you do not have to pay attention. Basically, I consider these examples as experimental approaches anyway. If there should be a conflict with a new version of O2, I will try to adjust those examples, and if I get stuck, I will ask for help (as always).

Roland
Title: Re: Self Compiling
Post by: Charles Pegge on November 15, 2018, 02:27:15 AM
Hi Roland,

It should not break any of your recent examples.

But there are two major differences:

o2-dependent binaries are no longer supported

secondary (dynamic compiling) is no longer supported. I think it could be replaced by an eval function.

I think I was the only one using these features :)
Title: Re: Self Compiling
Post by: John on December 11, 2018, 01:56:15 AM
Charles,

It would be great to have a high level diagram of how O2 is assembled. Maybe a block diagram or a category / function tree.

Would Doxygen work with o2.

I'm going to play around with Doxygen using Script BASIC C source. It has a treeview option we might be able to use as a reference for O2.
Title: Re: Self Compiling
Post by: Charles Pegge on December 11, 2018, 04:01:52 AM
Hi John,

The top-level organisation of o2:

BuildOxygenDLL.o2bas
Code: [Select]
  $dll
  $filename "oxygen.dll"
  uses RTL32
  uses main

main.inc components
Code: [Select]
  $ o2version chr(34)+"0.1.0 2018-12-11T12:00:00"+chr(34)
  '
  'DEFINITIONS GROUP
  '=================
  '
  uses glob 'GLOBAL STRUCTURES, CONSTANTS & VARIABLES
  uses lexa 'LOW LEVEL LEXING
  uses reco 'RECORDS
  uses lang 'CORE KEYWORDS AND EQUATES
  '
  'PARSING GROUP
  '=============
  '
  uses lexi 'LEXING
  uses pars 'PARSING
  '
  'COMPILATION GROUP
  '=================
  '
  uses meta 'META-PROGRAMMING
  uses decl 'DECLARATIVES
  uses enco 'ASM ENCODING FUNCTIONS
  uses expl 'LOWER EXPRESSIONS
  uses expr 'HIGHER EXPRESSIONS
  uses tran 'TOP TRANSLATION LAYER
  '
  'HEADERS ASSEMBLY AND LINKAGE GROUP
  '==================================
  '
  uses hdrs 'HEADERS FOR EXECUTABLE CODE
  uses assm 'ASSEMBLER (TO O2 MACHINE SCRIPT)
  uses link 'O2 MACHINE SCRIPT LINKER
  '

Title: Re: Self Compiling
Post by: Arnold on December 11, 2018, 04:11:22 AM
Hi John,

I do not see the link to sandbox.allbasic.info above any more. If I try to open it from allbasic.info I get a warning of a privacy error (the web site is not secure) and the page is not loaded. Is something missing?

What source control management tool can be used to fetch the contents of a project? I see there is TotoiseSVN, Mercurial and others. I do not know at the moment how these version control systems work. I also do not know if Charles will decide to apply such a history system at some point of Oxygen's development (which obviously is possible with GitHub too), but perhaps there are some advantages e.g. in view of the many examples which are provided with Oxygen. And perhaps Gitlab could be used for some major projects done with Oxygenbasic. Charles should not be held responsible for such kind of projects - maybe give some advice if necessary and appropriate.

Roland
Title: Re: Self Compiling
Post by: John on December 11, 2018, 10:45:34 AM
Roland,

There was a conflict between Plesk and Gitlab renewing Let's Encrypt certs. I hope the problem is resolved in the next day or two.

When Charles starts releasing tested examples using the SC compiler, I'm going to setup a new project under OxygenBasic for examples only. I will try to group them in like functioning categories.

Chrome will allow you to bypass the cert being expired. Firefox is a little more work.
Title: Re: Self Compiling
Post by: Charles Pegge on December 11, 2018, 08:16:25 PM
I'm refactoring a lot of symbols, involving hundreds of changes. So maybe diff is not the best viewing tool.
Title: Re: Self Compiling
Post by: John on December 11, 2018, 08:33:04 PM
Okay.

If folks want to track your changes they can view it in the O2 sandbox.

The idea behind posting the DIFF files was to help understand better how a compiler works.

I agree that this can get verbose.

Title: Re: Self Compiling
Post by: Arnold on January 19, 2019, 01:33:37 AM
Hi Charles,

with my editor of choice (PSPAD) I am able to compare now between these installations:

B0 2018-07-21 T 15:33:59 (OxygenbasicProgress of July/21/18)
B0 2018-03-12 T 06:46:15 (OxygenbasicProgress of Jan/14/19)
0.1.0 2019-01-15T06:08:44 (OXSC19 of Jan/15/19)

I am not sure about oxygen.dll of Jan/14. My explorer indicates a date of Oct/10/2018 so I assume it is newer despite the printed version? Does this version already include some features which were requested by Josť and Brian? I also assume this oxygen.dll was built using fbc.

For OXSC19 I used the /inc folder and also co2.exe, gxo2.exe of OxygenbasicProgress Jan/14. Is this ok? rtl32.inc and rtl64.inc are identical with the files of OXSC19.

I assume OXSC19 is the path which you want to develop further. Which features did you add/change with the self-compiled version? And is it ok to check some of the demos with it? With my compilation I can already achieve a lot.

I may ask too many questions here. But my only intention is not to be counterproductive and do the wrong actions. I would like to get the same outcome as you.

Roland

(Small joke)
Assistant: I did the calculation. And I recalculated it twice.
Boss: Well done.
Assistant: These are the three results.
Title: Re: Self Compiling
Post by: Mike Lobanovsky on January 19, 2019, 05:15:22 AM
Assistant: I did the calculation. And I recalculated it twice.
Boss: Well done.
Assistant: These are the three results.

In fact, nothing funny. He calc'ed and recalc'ed random numbers.

;D
Title: Re: Self Compiling
Post by: Arnold on January 20, 2019, 04:26:09 AM
Hi Mike,

yes, sometimes I will get more than one result, but at least one solution will work. Most of the time my apps will run with all three versions of Oxygen on my pc, either without or with minor modifications.

I am definitely surprised at the progress of the self-compiling variant of Oxygen.dll that Charles has already achieved. Sometimes there are missing error messages and Oxygen terminates silently. But with that in mind, it is already possible to develop and test programs. I did not expect this.

Roland