Advertisement
Guest User

Porting BlitzBASIC 2 PlayBASIC - First Look - (2022-02-20)

a guest
Feb 20th, 2022
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. Porting BlitzBASIC 2 PlayBASIC - First Look - (2022-02-20)
  2. https://www.youtube.com/watch?v=AfBmyFepfXQ&ab_channel=PlayBasic
  3. https://www.underwaredesign.com/forums/index.php?topic=4620.0
  4.  
  5. Script:
  6.  
  7. hi welcome back
  8.  
  9. very quick uh recording here we're
  10.  
  11. outside
  12.  
  13. and it's very noisy so
  14.  
  15. episode 8 of this conversion of
  16.  
  17. excellent GUI was all about doing
  18.  
  19. replacements of the original code
  20.  
  21. i'll give you a quick look at the the
  22.  
  23. result of that
  24.  
  25. so we went through and did replacements
  26.  
  27. of all of these
  28.  
  29. known functions
  30.  
  31. replace certain common syntaxes that
  32.  
  33. occur within the code
  34.  
  35. trouble is if we have to do multiple
  36.  
  37. multiple ports of this code in the
  38.  
  39. future
  40.  
  41. um we're going to end up having to do
  42.  
  43. this crap over and over again so i bit
  44.  
  45. the bullet yesterday
  46.  
  47. nice big truck driving pass
  48.  
  49. i bit the bullet and went
  50.  
  51. i'll convert one of the lexus to do this
  52.  
  53. job
  54.  
  55. to well at least have a framework for
  56.  
  57. doing this this kind of conversion job
  58.  
  59. from blitz to player basic so it'll
  60.  
  61. handle
  62.  
  63. at the moment it doesn't really handle
  64.  
  65. any of the translation at all it just
  66.  
  67. loads the document and splits it out
  68.  
  69. in a tokenized form for us to make the
  70.  
  71. modifications too so if we just run it
  72.  
  73. for example
  74.  
  75. so i can load the gui source code the
  76.  
  77. 9000 lines in about a third of a second
  78.  
  79. which is pretty good
  80.  
  81. if we write in debug mode
  82.  
  83. we can investigate some of the stuff
  84.  
  85. that's happening it spits out a bunch of
  86.  
  87. garbage to the console
  88.  
  89. and it's working through you know
  90.  
  91. so into variables up here
  92.  
  93. we look at sort of the stats we've got
  94.  
  95. thirty thousand searches hash collisions
  96.  
  97. collisions are about ten percent of that
  98.  
  99. in other words keywords that have the
  100.  
  101. same hash
  102.  
  103. or has to do a second search
  104.  
  105. um
  106.  
  107. we're just using using play basics
  108.  
  109. internal
  110.  
  111. find array stuff to do that sort of
  112.  
  113. stuff in this one
  114.  
  115. sorry the keywords are split up into
  116.  
  117. a bunch of different blocks they can
  118.  
  119. have constants
  120.  
  121. uh
  122.  
  123. directives and command names
  124.  
  125. the code i grabbed before was the one i
  126.  
  127. posted the other day just sort of
  128.  
  129. butchered it up to do to do
  130.  
  131. rather than convert pb to html was just
  132.  
  133. kind of import some blitz and do some
  134.  
  135. modifications to it
  136.  
  137. i mean the goal is really to get a few
  138.  
  139. simple passes that would do a lot of the
  140.  
  141. annoying grant work for us so if you
  142.  
  143. ever have to convert more blips code
  144.  
  145. across which is probably going to happen
  146.  
  147. at some point
  148.  
  149. i've got a bunch of things i wouldn't
  150.  
  151. mind converting
  152.  
  153. that i wrote in blitz to pb for example
  154.  
  155. and i'm sure others have the same thing
  156.  
  157. the objective is not to make this thing
  158.  
  159. work
  160.  
  161. as in spit out working code i mean for
  162.  
  163. some programs it probably will
  164.  
  165. simple programs but our objectives to
  166.  
  167. make a lot of the
  168.  
  169. annoying
  170.  
  171. you know sort of
  172.  
  173. crappy work that you have to do all the
  174.  
  175. time
  176.  
  177. like uh certain replacements etc
  178.  
  179. if you go up to here
  180.  
  181. back to the original code here with
  182.  
  183. things like you know word replacements
  184.  
  185. for while loops and um
  186.  
  187. i think there's ones there for
  188.  
  189. even types of different keywords
  190.  
  191. so
  192.  
  193. our translator will do things like it'll
  194.  
  195. merge this into one word it'll pull out
  196.  
  197. the field stuff
  198.  
  199. it'll look at the fields themselves and
  200.  
  201. give us an indication of what this
  202.  
  203. should be
  204.  
  205. um
  206.  
  207. well i think the conversion should be to
  208.  
  209. emulate what blips are doing
  210.  
  211. you'll have to probably fix those up
  212.  
  213. yourself but you know
  214.  
  215. so a lot of this would just be import
  216.  
  217. spit out and then then you start to your
  218.  
  219. yeah you start your hands on work from
  220.  
  221. there
  222.  
  223. because a lot of this stuff it needs to
  224.  
  225. get done
  226.  
  227. that you'd be constantly doing every
  228.  
  229. time you import something my initial
  230.  
  231. theory was well i might just uh
  232.  
  233. as i was talking about in episode 8
  234.  
  235. which i'll cut that together at some
  236.  
  237. point and put that up i was talking
  238.  
  239. about
  240.  
  241. making a translator that just looked
  242.  
  243. through this particular input code
  244.  
  245. found the common things that i'm
  246.  
  247. interested in and then re you know laid
  248.  
  249. them out in such a way that that's going
  250.  
  251. to be
  252.  
  253. comfortable for pv
  254.  
  255. the more i thought about that the more i
  256.  
  257. thought well
  258.  
  259. what we really need to do is have
  260.  
  261. something that will
  262.  
  263. be more generalized and do roughly the
  264.  
  265. same thing so if we tokenize it first
  266.  
  267. and sweep through it and clear it up
  268.  
  269. that's how we'll do it
  270.  
  271. that's enough enough for now i'll give
  272.  
  273. you
  274.  
  275. some more updates on this as we go
  276.  
  277. through
  278.  
  279. um
  280.  
  281. i'd say that by probably the next day or
  282.  
  283. so it'll be doing most of the
  284.  
  285. translations we're doing already
  286.  
  287. any blitz functions they'll be they'll
  288.  
  289. end up as wrapped codes i'll have this
  290.  
  291. this uh
  292.  
  293. they'll be prefaced with where are we
  294.  
  295. here
  296.  
  297. oh no that's the original code sorry
  298.  
  299. um
  300.  
  301. i kept two versions so yeah they'll have
  302.  
  303. they'll end up with bb underscore
  304.  
  305. wrapper under them so you would have to
  306.  
  307. make
  308.  
  309. a function in pb code that emulates what
  310.  
  311. that function does
  312.  
  313. uh over time we'll build a list of these
  314.  
  315. emulated functions and this will make
  316.  
  317. more programs work they won't be optimal
  318.  
  319. but they'll kind of work you know
  320.  
  321. that's the goal you know i'll spend a
  322.  
  323. bit of time on it and see if we can get
  324.  
  325. to a point where it where it saves time
  326.  
  327. not just for this project for other
  328.  
  329. products down the road
  330.  
  331. little different amp thanks for
  332.  
  333. listening and i'll see you next time bye
  334.  
  335.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement