Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Porting BlitzBASIC 2 PlayBASIC - First Look - (2022-02-20)
- https://www.youtube.com/watch?v=AfBmyFepfXQ&ab_channel=PlayBasic
- https://www.underwaredesign.com/forums/index.php?topic=4620.0
- Script:
- hi welcome back
- very quick uh recording here we're
- outside
- and it's very noisy so
- episode 8 of this conversion of
- excellent GUI was all about doing
- replacements of the original code
- i'll give you a quick look at the the
- result of that
- so we went through and did replacements
- of all of these
- known functions
- replace certain common syntaxes that
- occur within the code
- trouble is if we have to do multiple
- multiple ports of this code in the
- future
- um we're going to end up having to do
- this crap over and over again so i bit
- the bullet yesterday
- nice big truck driving pass
- i bit the bullet and went
- i'll convert one of the lexus to do this
- job
- to well at least have a framework for
- doing this this kind of conversion job
- from blitz to player basic so it'll
- handle
- at the moment it doesn't really handle
- any of the translation at all it just
- loads the document and splits it out
- in a tokenized form for us to make the
- modifications too so if we just run it
- for example
- so i can load the gui source code the
- 9000 lines in about a third of a second
- which is pretty good
- if we write in debug mode
- we can investigate some of the stuff
- that's happening it spits out a bunch of
- garbage to the console
- and it's working through you know
- so into variables up here
- we look at sort of the stats we've got
- thirty thousand searches hash collisions
- collisions are about ten percent of that
- in other words keywords that have the
- same hash
- or has to do a second search
- um
- we're just using using play basics
- internal
- find array stuff to do that sort of
- stuff in this one
- sorry the keywords are split up into
- a bunch of different blocks they can
- have constants
- uh
- directives and command names
- the code i grabbed before was the one i
- posted the other day just sort of
- butchered it up to do to do
- rather than convert pb to html was just
- kind of import some blitz and do some
- modifications to it
- i mean the goal is really to get a few
- simple passes that would do a lot of the
- annoying grant work for us so if you
- ever have to convert more blips code
- across which is probably going to happen
- at some point
- i've got a bunch of things i wouldn't
- mind converting
- that i wrote in blitz to pb for example
- and i'm sure others have the same thing
- the objective is not to make this thing
- work
- as in spit out working code i mean for
- some programs it probably will
- simple programs but our objectives to
- make a lot of the
- annoying
- you know sort of
- crappy work that you have to do all the
- time
- like uh certain replacements etc
- if you go up to here
- back to the original code here with
- things like you know word replacements
- for while loops and um
- i think there's ones there for
- even types of different keywords
- so
- our translator will do things like it'll
- merge this into one word it'll pull out
- the field stuff
- it'll look at the fields themselves and
- give us an indication of what this
- should be
- um
- well i think the conversion should be to
- emulate what blips are doing
- you'll have to probably fix those up
- yourself but you know
- so a lot of this would just be import
- spit out and then then you start to your
- yeah you start your hands on work from
- there
- because a lot of this stuff it needs to
- get done
- that you'd be constantly doing every
- time you import something my initial
- theory was well i might just uh
- as i was talking about in episode 8
- which i'll cut that together at some
- point and put that up i was talking
- about
- making a translator that just looked
- through this particular input code
- found the common things that i'm
- interested in and then re you know laid
- them out in such a way that that's going
- to be
- comfortable for pv
- the more i thought about that the more i
- thought well
- what we really need to do is have
- something that will
- be more generalized and do roughly the
- same thing so if we tokenize it first
- and sweep through it and clear it up
- that's how we'll do it
- that's enough enough for now i'll give
- you
- some more updates on this as we go
- through
- um
- i'd say that by probably the next day or
- so it'll be doing most of the
- translations we're doing already
- any blitz functions they'll be they'll
- end up as wrapped codes i'll have this
- this uh
- they'll be prefaced with where are we
- here
- oh no that's the original code sorry
- um
- i kept two versions so yeah they'll have
- they'll end up with bb underscore
- wrapper under them so you would have to
- make
- a function in pb code that emulates what
- that function does
- uh over time we'll build a list of these
- emulated functions and this will make
- more programs work they won't be optimal
- but they'll kind of work you know
- that's the goal you know i'll spend a
- bit of time on it and see if we can get
- to a point where it where it saves time
- not just for this project for other
- products down the road
- little different amp thanks for
- listening and i'll see you next time bye
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement