Author Topic: Bytecode Interpreter concept  (Read 29575 times)

0 Members and 3 Guests are viewing this topic.

Aurel

  • Guest
Re: Bytecode Interpreter concept
« Reply #60 on: May 26, 2014, 06:37:18 AM »
Yeah Mike ..
maybe i am and maybe i'm not
Don't forget that i use oxygen more than you and i know when i can escpect
quirks....
from the other side you have far more experience in that stuff
and FBSL version work very well..
« Last Edit: May 26, 2014, 01:58:20 PM by Aurel »

Kuron

  • Guest
Re: Bytecode Interpreter concept
« Reply #61 on: May 26, 2014, 01:49:42 PM »
John:  Thank you, my friend.


Quote
You could have used FBSL v3.X XXX yesterday, a year, or a decade ago without any special permission. I said it was specifically meant for education, self-education, and fun from its very beginning. Go ahead with FBSL any time you feel like it. There is no need to contact anybody for any permission or license whatsoever and there never was. :)

Why didn't you start with that message in the first place? :)


Two different posts, two different things. ;c) 

The first post was about using FBSL for some contract work.  Technically, I quit taking contract work at the end of the year and from now on I am supposed to only be programming what I want to instead of what I am paid to do.  Any income was supposed to come from my music.  Unfortunately, with the injuries to my left hand, I can't play guitar very easily right now and trying to keep doing it is not letting the hand heal.

I am contemplating picking up some contract work if finances get tight.  I have moved all of my systems over to Linux, so this would mean setting up a Windows system and deciding on a programming language to use.  Unless I do some contract work, I no longer plan to release any Windows software.  Even if I was not doing contract work and was solely working on freeware, even if I put out some Windows stuff, the current license of FBSL would not work in my situation, since the freeware would be released by a company that still brings in revenue from other sources.

The second post was about use for a programming class I have taught off and on over the years, as a summer program and as an after school program.  The class is not free, there is a registration fee.  I am also not positive I am going to do it when school goes back in session.  Dealing with a lot of heavy stuff at  this time.  I might skip it again this year.  If I were to do it, using MiniBasic would make it much simpler as I already have the course material written.

Either way, I will be checking out FBSL 3.5 when it is released.  I should have Wine figured out by then. LOL

Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #62 on: May 26, 2014, 11:19:30 PM »
Thanks for clarifying your situation, Kuron!

While you're certainly not supposed to use FBSL under the circumstances as per paragraph 2 without a license, you could have, and still can, use FBSL freely for the purposes of paragraph 3 even if you're going to be paid for your educational work. Public benefit of your educational activities clearly and definitively outweighs all other considerations, and cash refund of a teacher for his work has nothing to do with the "commercial activity" concept. (I'm an English and French school teacher myself by two of my numerous certified specialities, and was also a long time bass guitar player in a semi-professional hard rock band back in 70's/80's.)

Get well soon and thanks again for your interest in FBSL! :)

Aurel

  • Guest
Re: Bytecode Interpreter concept
« Reply #63 on: May 28, 2014, 11:18:59 AM »
Again back to topic...

i have strange problem with this function which looks to me
very unlogical, this function have two arguments...
and as return tend to use one argument what is wrong...

Code: [Select]
' see if an ident exists in the symbol table - boolean return
function is_in_sym_tab(ident as string, address as long) as long
    dim i as int

    i = find_sym_tab(ident)
    if i = 0 then
        'is_in_sym_tab = false
        exit function
    end if

    address = sym_tab[i].data_index
    is_in_sym_tab = true

end function

Ed Davis

  • Guest
Re: Bytecode Interpreter concept
« Reply #64 on: May 28, 2014, 12:17:55 PM »
Its a bug.  address should be "byref".

The goal is to determine if a symbol has already been defined, and if it has, return its address.

It is corrected in Mike Lobanovsky FBSL version.
« Last Edit: May 28, 2014, 12:26:43 PM by Ed Davis »

Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #65 on: May 28, 2014, 12:29:45 PM »
@Ed:

Hard to tell if it is or it isn't. If what he has here comes from FB -lang qb or from FBSL then ByRef is the language default when not specified explicitly. So address will change its value in the caller code alright either way.

P.S. ByRef is used in my FBSL port deliberately only to stress what I've said above. Otherwise it may be omitted to the same effect.

@Aurel:

Whenever you publish a question, can you please specify exactly what code we're seeing in your example: FB, FBSL, Oxygen, or some intermediate stage of you porting efforts?

Thank you.
« Last Edit: May 28, 2014, 12:52:52 PM by Mike Lobanovsky »

Aurel

  • Guest
Re: Bytecode Interpreter concept
« Reply #66 on: May 28, 2014, 01:24:01 PM »
Thanks Ed i will look into Mike- FBSL version.  ;)

Mike
Yes it is translation to Oxygen ..so code is in Oxygen Basic.
It is very messy right now but i hope that i will fix few quirks.  ::)
Good thing is that we have your FBSL version which looks that work as
is suposed to be .

Kuron

  • Guest
Re: Bytecode Interpreter concept
« Reply #67 on: June 08, 2014, 11:22:16 AM »
While you're certainly not supposed to use FBSL under the circumstances as per paragraph 2 without a license, you could have, and still can, use FBSL freely for the purposes of paragraph 3 even if you're going to be paid for your educational work. Public benefit of your educational activities clearly and definitively outweighs all other considerations, and cash refund of a teacher for his work has nothing to do with the "commercial activity" concept. (I'm an English and French school teacher myself by two of my numerous certified specialities, and was also a long time bass guitar player in a semi-professional hard rock band back in 70's/80's.)

Get well soon and thanks again for your interest in FBSL! :)
To be clear, I don't get paid for my teaching.  It is strictly volunteer work.  The fees are charged by the center and go for covering insurance and other expenses for the kids. :)

On the bright side, they re building a new community center, so eventually, the programming class will be back.

Bass, huh?  I play bass too (among several other instruments).


Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #68 on: June 08, 2014, 12:23:30 PM »
On the bright side, they re building a new community center, so eventually, the programming class will be back.
Excellent! :)

Quote
Bass, huh?  I play bass too (among several other instruments).
Unfortunately I can't do that any more due to visible contractures in my ring and little fingers but my black Gibson Les Paul Bass still stands in its case deep in my wardrobe, and my four Peavey Bandits, in my garage. :)

Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #69 on: July 23, 2014, 08:31:46 AM »
Hello everybody,

I didn't want to push Charles unnecessarily so it did take O2 some time to sort out its memory problems. I'm glad to announce that Oxygen is now fit to compile and run Ed Davis' Toy interpreter correctly. Attached you will find a precompiled executable as well as toy.o2bas and primes.toy scripts to match.

The O2 version looks and works exactly like its earlier FBSL counterpart barring minor differences in Select Case handling and an O2 Do/Loop block that substitutes the original FBSL While/WEnd that still causes severe memory corruption in O2. You can find it commented out in Sub get_ident().

Wows and awesomes appreciated but not absolutely necessary. :D



.

Aurel

  • Guest
Re: Bytecode Interpreter concept
« Reply #70 on: July 23, 2014, 11:44:47 AM »
what to say ...fine  ;)
well i can't say that for my version because i want create version without console.
Quote
While/WEnd that still causes severe memory corruption in O2
hmm that maybe a part of problem with my version but i am not sure because i have
to much errors or I mess up something ...

all in all.... thanks Mike  ;)
« Last Edit: July 23, 2014, 11:56:03 AM by Aurel »

Charles Pegge

  • Guest
Re: Bytecode Interpreter concept
« Reply #71 on: July 23, 2014, 11:49:05 PM »
Many thanks Mike.

I checked the troublesome 'while' loop. The assembly code appears to be okay at first glance, but I will investigate further.

Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #72 on: July 24, 2014, 12:12:03 AM »
Hi Charles,

The triple OR conditional with two direct function calls in it doesn't work for me here in either a While or an If statement. :-\

All other While/WEnd and If/Then blocks throughout the script are simpler in this regard.

Charles Pegge

  • Guest
Re: Bytecode Interpreter concept
« Reply #73 on: July 24, 2014, 12:49:30 AM »
The problem is with a string comparison in a compound statement. All other aspects look ok.

Code: [Select]
#show while is_alpha() or is_numeric() 'or cur_ch+" " = "_"
token = token & cur_ch
next_char()
wend

Mike Lobanovsky

  • Guest
Re: Bytecode Interpreter concept
« Reply #74 on: July 24, 2014, 11:21:00 AM »
Oh, I see.

Then

Code: [Select]
byte c = asc(cur_ch)

while is_alpha() or is_numeric() or c = 95 ' asc("_")
token = token & cur_ch
next_char()
wend

might cure the situation in situ. But that'll be only a palliation, sort of yet another "crutch", don't you think?