code logs -> 2018 -> Sun, 25 Feb 2018< code.20180224.log - code.20180226.log >
--- Log opened Sun Feb 25 00:00:20 2018
00:03
<&McMartin>
woot
00:04
<&McMartin>
You have actually recreated a technique very similar to what yacc, bison and other first-gen parser generators do; maintaining a stack of tokens and then evaluating what to do based on what's coming next
00:05
<&[R]>
Took me a while to figgure it out, there's still some bugs though
00:05
<&McMartin>
The other major technique, often more popular for hand-written parsers but formally somewhat more constrained unless you do some trickery, is called "recursive descent"
00:05
<&McMartin>
Where you have one function for each kind of thing you can parse out, and they call each other as needed based on what's coming up next.
00:06
<&McMartin>
So the trick there is that you can make precedence fall straight out of it
00:06
<&McMartin>
expr = term + expr
00:06
<&McMartin>
term = term * factor
00:06
<&McMartin>
factor = dieroll | str | number | - factor | ( expr )
00:07
<&McMartin>
In the stack based system you either shift or reduce based on what you have and what you see.
00:08 Degi [Degi@Nightstar-orn9ji.dyn.telefonica.de] has joined #code
00:08
<&McMartin>
er
00:08
<&McMartin>
term = factor * term up there
00:08
<&McMartin>
One of the things recursive descent is real bad at is handling cases where the first item in the formula is something that can make a loop
00:09
<&McMartin>
(This can be fixed by means of a mechanical translation, which is good, becuase which one is the recursive term *also* ends up determining the associativity of the operator, if it matters.)
00:10 * [R] barely follows
00:11
<&McMartin>
Yeah, I, uh, kind of just went through half of a third-year university course in two screens there >_>
00:12
<&McMartin>
Let me also then link some code where I used that alternate technique, albeit in Python and with a medium-strong C accent. https://github.com/michaelcmartin/Ophis/blob/master/src/Ophis/Frontend.py
00:13
<&[R]>
I'm having trouble with the (...)*num case
00:14
<&[R]>
It's coming out flat, so the paren operation is in the same group as the following multiplications, which is going to make evaluation more complicated
00:15
<&McMartin>
OK, so that's part of an issue right there
00:15
<&McMartin>
Paren has higher precedence than mult.
00:17
<&McMartin>
Or rather, it should have higher precedence
00:23
<&McMartin>
.
00:23
<&McMartin>
"-funsafe-math-optimizations allows math optimizations that assume valid arguments and can violate ANSI and IEEE standards (caution, not actually fun and safe)"
00:30
<&ToxicFrog>
I have seen some really neat bugs related to -funsafe-math-optimizations.
00:30
<&ToxicFrog>
I think my favourite was a 3d cityscape renderer where compiling with that flag, on certain compiler version/runtime architecture combinations, resulted in ~1% of the city melting.
00:56
<&[R]>
Okay, got the parens issue fixed!
01:02
<&[R]>
I wasn't consistient about how I was handling the current stack state.
01:43 Kindamoody is now known as Kindamoody[zZz]
01:57 Derakon[AFK] is now known as Derakon
01:57 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed]
02:08 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
02:08 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
02:09
<&McMartin>
Oh my goodness
02:10
<&McMartin>
ToxicFrog: Incidentally, not only does ImageMagick's convert utility output XPM, it seems that my stock copy of emacs will *render the graphic for you* if you load it up, with C-c C-c flipping between "look at it" and "text buffer"
02:15
<&ToxicFrog>
That is pretty cool.
02:18
<&McMartin>
That will be really nice if I decide to be hardcore and manually clean up scaling artifacts after colordepth drops.
02:25 * McMartin dumps out 16 KB of highly redundant tile data.
02:29 Degi [Degi@Nightstar-orn9ji.dyn.telefonica.de] has quit [Connection closed]
02:37 Jessikat` [Jessikat@Nightstar-p8o959.dab.02.net] has quit [Ping timeout: 121 seconds]
02:43
<&[R]>
Which one is XPM again? The X11 image format that's actually an C header, or the image format DOS games used to use but nothing uses anymore?
02:43
<&McMartin>
The grandchild of the former.
02:44
<&[R]>
Ah
02:44
<&[R]>
What am I thinking about with the latter?
02:46
<&[R]>
PCX I think
02:46
<&McMartin>
Could be. It was certainly that thing.
02:48
<&McMartin>
Not a terrible format, for what it needed to be, but it ended up getting expanded further than it could comfortably go, and as a result ended up getting subsumed by BMP.
03:05
<&ToxicFrog>
[R]: XPMv1 is C header, XPMv2 is plain text file containing the same data
03:05
<&ToxicFrog>
(there's also the older XBM, which, as the name implies, does black and white only)
04:29 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
04:31 Pink` [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
04:31 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
04:33 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
04:55 Vornlicious [Vorn@Nightstar-5t04kl.sub-174-211-5.myvzw.com] has joined #code
04:56 Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds]
04:57 Vorntastic [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds]
05:15 Derakon is now known as Derakon[AFK]
05:19
<&McMartin>
ImageMagick actually produces XPMv3, which is C header again but in a different format.
05:20 * McMartin meanwhile has cleaned up this image as much as it will clean.
05:20
<&McMartin>
I really need a new Dignified Umbrella In Snow logo that survives drops in resolution or color depth without making the handle vanish.
05:24
<&McMartin>
https://i2.wp.com/bumbershootsoft.files.wordpress.com/2018/02/smd_orin_logo.png
05:31
< Vornlicious>
Wow, yeah
05:34
<&McMartin>
And that result is after a great deal of manual cleanup to prevent the text from becoming an illegible mess, but, well, yeah, don't shrink then dither your text, kids
05:34
<&McMartin>
Also man that logo is like 15 years old now
05:35
<&McMartin>
Also now that I have roughly 16KB of memory that needs to be blitted unchanged to VRAM...
05:35
<&McMartin>
... I finally have an excuse to deploy BLAST PROCESSING
05:35
<&McMartin>
Because I totally can't actually post an I-did-a-thing for the Genesis unless it includes BLAST PROCESSING.
05:36
<&McMartin>
(Caveat: BLAST PROCESSING happens during system initialization when it's resetting the graphics chip into a known state. This does not count.)
05:47
< Vornlicious>
Blast
05:48
<&McMartin>
Also yes this is what you get when you give a dumb marketing name to an extremely ubiquitous hardware feature.
05:48
<&McMartin>
(BLAST PROCESSING was programmable DMA)
05:50
< Vornlicious>
MC Programmable DMA is my rapper name
05:50
<&McMartin>
And this case you're even backed up by MC68000
05:52
< Vornlicious>
Nice
06:18 Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code
06:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
06:32 Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds]
07:15 * McMartin gets his DMA working.
07:25 Jessikat [Jessikat@Nightstar-o84ov0.dab.02.net] has joined #code
08:00 * McMartin greets Jessikat with BLAST PROCESSING and half-competently downgraded images. https://i2.wp.com/bumbershootsoft.files.wordpress.com/2018/02/smd_orin_logo.png
08:00
< Jessikat>
Invisible umbrella stem, I like it
08:02
<&McMartin>
Yeah, this source image from 15 years ago is seriously vulnerable to that =(
08:03
< Jessikat>
:<
08:04
<&McMartin>
The original source image is like 512 tall and even if you scale down with full 24-bit color the stem keeps vanishing
08:04
<&McMartin>
But! I got data import into the Mega Drive working, plus DMA transfer from ROM to VRAM
08:04
<&McMartin>
I really only have a couple more things to do in isolation before I'm actually happy with my command of the hardware.
08:05
<&McMartin>
(Input scan and the other three sound modes, basically.)
08:06 celticminstrel is now known as celmin|sleep
09:00 Kindamoody[zZz] is now known as Kindamoody
09:04 Jessikat` [Jessikat@Nightstar-r7d8vk.dab.02.net] has joined #code
09:07 Jessikat [Jessikat@Nightstar-o84ov0.dab.02.net] has quit [Ping timeout: 121 seconds]
09:09 Kindamoody is now known as Kindamoody|afk
09:22 Jessikat` is now known as Jessikat
09:35 Jessikat [Jessikat@Nightstar-r7d8vk.dab.02.net] has quit [[NS] Quit: Bye]
10:34 gnolam [lenin@Nightstar-ego6cb.cust.bahnhof.se] has quit [[NS] Quit: Gone]
10:55 gnolam [lenin@Nightstar-ego6cb.cust.bahnhof.se] has joined #code
10:55 mode/#code [+o gnolam] by ChanServ
11:48 Jessikat [Jessikat@Nightstar-fuqq53.dab.02.net] has joined #code
11:57 Jessikat [Jessikat@Nightstar-fuqq53.dab.02.net] has quit [[NS] Quit: Bye]
12:14 * Vornlicious frustrates at web compatibility tables
12:29 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
12:30 Pink` [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
12:37 Pink is now known as ASCII
12:46 Degi [Degi@Nightstar-mijjeu.dyn.telefonica.de] has joined #code
14:23 gnolam [lenin@Nightstar-ego6cb.cust.bahnhof.se] has quit [[NS] Quit: This year can fuck off and die already]
15:10 Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code
15:10 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:57 Degi is now known as Degi[afk]
16:14 Vornlicious [Vorn@Nightstar-5t04kl.sub-174-211-5.myvzw.com] has quit [[NS] Quit: Bye]
16:14 Vorntastic [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code
16:14 gnolam [quassel@Nightstar-f22.ckv.119.62.IP] has joined #code
16:14 mode/#code [+o gnolam] by ChanServ
16:27 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has joined #code
16:51 celmin|sleep is now known as celticminstrel
16:59 Degi[afk] is now known as Degi
17:14 Vornlicious [Vorn@Nightstar-ils7ka.sub-174-211-19.myvzw.com] has joined #code
17:18 Vorntastic [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds]
17:26 Kindamoody|afk is now known as Kindamoody
18:24 gnolam [quassel@Nightstar-f22.ckv.119.62.IP] has quit [[NS] Quit: Blergh]
18:32 Derakon[AFK] is now known as Derakon
18:46 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has quit [[NS] Quit: Bye]
18:47 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has joined #code
18:47 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has quit [The TLS connection was non-properly terminated.]
21:40 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has joined #code
22:24 Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds]
22:36 Jessikat` [Jessikat@Nightstar-unn.equ.132.82.IP] has joined #code
22:39 Jessikat [Jessikat@Nightstar-ioe4tq.dab.02.net] has quit [Ping timeout: 121 seconds]
22:41 gnolam [quassel@Nightstar-hsn6u0.cust.bahnhof.se] has joined #code
22:41 mode/#code [+o gnolam] by ChanServ
23:13 ASCII [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Connection closed]
23:14 ASCII [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
23:18 Degi [Degi@Nightstar-mijjeu.dyn.telefonica.de] has quit [Connection closed]
23:21 Jessikat` [Jessikat@Nightstar-unn.equ.132.82.IP] has quit [Ping timeout: 121 seconds]
23:23 gnolam [quassel@Nightstar-hsn6u0.cust.bahnhof.se] has quit [[NS] Quit: Z?]
23:26 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [[NS] Quit: Time for the weekly kernel upgrade]
23:47 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
23:48 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
23:48 mode/#code [+ao McMartin McMartin] by ChanServ
23:50 ASCII [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
--- Log closed Mon Feb 26 00:00:22 2018
code logs -> 2018 -> Sun, 25 Feb 2018< code.20180224.log - code.20180226.log >

[ Latest log file ]