code logs -> 2017 -> Sun, 18 Jun 2017< code.20170617.log - code.20170619.log >
--- Log opened Sun Jun 18 00:00:16 2017
01:04
<&ToxicFrog>
Ahahaha
01:04
<&ToxicFrog>
#define SAFETY_CHECKS was using a bunch of RAM, but I couldn't figure out where
01:04
<&ToxicFrog>
Answer: __FILE__
01:05
<&ToxicFrog>
Fixed it by replacing printf_P(PSTR("%s:%d: ..."), __FILE__, __LINE__, ...)
01:05
<&ToxicFrog>
With printf_P(PSTR(__FILE__ ":%d: ..."), __LINE__, ...)
01:08
<&ToxicFrog>
Boom, another 170 bytes of RAM saved and RAM usage is now *below* where it was before I started adding proper error reporting.
01:08
<&ToxicFrog>
(it's at 430b now, most of that the serial library; briefly it was around 1.2k)
01:14
<&ToxicFrog>
Hmm. But now I've broken serial IO on the AVR.
01:25
<&ToxicFrog>
Fixed, turns out that it's kind of important to not interleave calls that talk to stdio and calls that talk directly to the UART if you want either one to behave sensibly
01:25 * ToxicFrog does some numbers
01:26
<&ToxicFrog>
Language core, no builtins, no safety checks, no repl: 4k flash/200b RAM.
01:27
<&ToxicFrog>
Builtins add 1.4k and 18 bytes. I'm not actually sure where those 18 bytes come from; I would expect 0.
01:28
<&ToxicFrog>
Oh, wait, yes I am, some of them have string constants in them.
01:29
<&ToxicFrog>
Turning on SAFETY_CHECKS adds another 2k of flash and 23 bytes of RAM.
01:30
<&ToxicFrog>
And finally, SERIAL_REPL adds a whopping 5k of flash and 180 bytes of RAM.
01:43
< RchrdB>
huh how is the one with (__FILE__ ":d") using less memory than the one with ("%s:%d"), __FILE__?
01:43
<&[R]>
UART?
01:44
< RchrdB>
shouldn't all those string constants generated by different instances of __FILE__ (for each given file) be smooshed together to share memory either way?
01:55
<&ToxicFrog>
[R]: the chip that mediates between the microcontroller and the actual serial lines
01:55
<&ToxicFrog>
RchrdB: the key is the PSTR
01:55
<&ToxicFrog>
Which is a macro that means "store this string in flash rather than in RAM"
01:56
< RchrdB>
uh... huh
01:56
<&ToxicFrog>
Similarly, printf_P is a variant of printf that expects the format string to be in flash and reads it byte-by-byte out of there.
01:56
< RchrdB>
and is the linker not deduplicating string constants in flash?
01:56
<&ToxicFrog>
It is
01:56
<&ToxicFrog>
The bit you're missing is that in the "before" line __FILE__ is outside the PSTR() and thus gets stored in RAM.
01:57
<&ToxicFrog>
170 bytes is the difference between storing all the filenames once each in RAM and storing them once each in flash.
01:58
< RchrdB>
ahhhh
01:59
<&ToxicFrog>
The total data used is the same, but I have 2k of RAM and 32k of flash, so I want to put as much stuff in flash as possible.
02:31
<&ToxicFrog>
oh this is exciting
02:31
<&ToxicFrog>
the AVR has 8-bit registers and 16-bit address space but `long int` is 32 bits
02:31
<&ToxicFrog>
Do not get these mixed up when calling printf
02:59 RchrdB [RchrdB@Nightstar-qe9.aug.187.81.IP] has quit [Ping timeout: 121 seconds]
03:21 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
04:05
<&McMartin>
Aha! That's where I'd seen the ATmega named before
04:05
<&McMartin>
The Commodore SD card reader is powered by an ATmega.
05:43 celticminstrel [celticminst@Nightstar-cn2je9.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
06:24 Kindamoody[zZz] is now known as Kindamoody
07:18 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
07:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
07:50 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
09:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
09:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
09:40 Kindamoody is now known as Kindamoody|afk
09:43 Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
11:28 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
11:33
<&ToxicFrog>
I should write a syntax hilighting file for notforth, but I really don't want to.
11:36 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
11:36 mode/#code [+o himi] by ChanServ
11:44 Alek [Alek@Nightstar-7or629.il.comcast.net] has quit [Ping timeout: 121 seconds]
11:47 Alek [Alek@Nightstar-7or629.il.comcast.net] has joined #code
11:47 mode/#code [+o Alek] by ChanServ
12:39
<&ToxicFrog>
b954f1f Add syntax hilighting rules; update some comments
12:39
<&ToxicFrog>
I may have a problem
12:41
<~Vornicus>
You may
12:42
<&ToxicFrog>
I've successfully broken the dependency on the Arduino serial library, though.
12:42
<&ToxicFrog>
Not on the Arduino libraries in general, as yet -- they do a lot of hardware initialization stuff I haven't replicated -- but RAM usage is now down to 148 bytes.
12:42
<&ToxicFrog>
I am quite pleased with that.
12:59
<~Vornicus>
that is quite good
13:04
<&ToxicFrog>
Huh.
13:04
<&ToxicFrog>
this works:
13:04
<&ToxicFrog>
{ . } 1 11 for
13:04
<&ToxicFrog>
this stackunderflows:
13:04
<&ToxicFrog>
@. 1 11 for
13:04
<&ToxicFrog>
They should be eqv.
13:06
<&ToxicFrog>
They look eqv:
13:06
<&ToxicFrog>
[0] @. { . } list list
13:06
<&ToxicFrog>
## (anonymous) :: bytecode @ 0x1eaca20
13:06
<&ToxicFrog>
call native @ 0x401a20 # .
13:06
<&ToxicFrog>
## . :: native code @ 0x401a20
13:08
<&ToxicFrog>
[0] 0xff @. exec
13:08
<&ToxicFrog>
zsh: segmentation fault ./notforth
13:08
<&ToxicFrog>
WELL THEN
13:15
<&ToxicFrog>
oh hahahaha wait
13:15
<&ToxicFrog>
This is the bug I found last night while writing documentation, made a note to fix, but haven't fixed yet
13:16
<&ToxicFrog>
im coder
14:16 celticminstrel [celticminst@Nightstar-cn2je9.dsl.bell.ca] has joined #code
14:16 mode/#code [+o celticminstrel] by ChanServ
15:05 Netsplit Deepthought.Nightstar.Net <-> Krikkit.Nightstar.Net quits: @iospace, @abudhabi, @Syloq, @Attilla, @Pi, starkruzr_, @macdjord, @Reiver, @celticminstrel, @Kindamoody|afk, (+17 more, use /NETSPLIT to show all of them)
15:05 Netsplit over, joins: @PinkFreud, @Syloq
18:46 [R] [rstamer@genoce.org] has joined #code
18:46 Namegduf [namegduf@Nightstar-lcgn9d.beshir.org] has joined #code
18:46 Mahal [sid171286@Nightstar-0bi4dv.irccloud.com] has joined #code
18:46 gnolam [lenin@Nightstar-ian7gg.cust.bahnhof.se] has joined #code
18:46 Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code
18:46 Tamber [tamber@furryhelix.co.uk] has joined #code
18:46 starkruzr_ [quassel@Nightstar-9848jp.fios.verizon.net] has joined #code
18:46 abudhabi [abudhabi@Nightstar-7nkq9k.de] has joined #code
18:46 Azash [Azash@wizard.engineering] has joined #code
18:46 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
18:46 JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has joined #code
18:46 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
18:46 Alek [Alek@Nightstar-7or629.il.comcast.net] has joined #code
18:46 Turaiel[Offline] [Brandon@Nightstar-8t8.2pu.55.45.IP] has joined #code
18:46 jerith [jerith@Nightstar-ip7ar2.slipgate.net] has joined #code
18:46 macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code
18:46 celticminstrel [celticminst@Nightstar-cn2je9.dsl.bell.ca] has joined #code
18:46 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
18:46 iospace [Alexandria@Nightstar-fkokc2.com] has joined #code
18:46 Kindamoody|afk [Kindamoody@Nightstar-0lgkcs.tbcn.telia.com] has joined #code
18:46 crystalclaw [crystalclaw@Nightstar-stv.hcc.175.199.IP] has joined #code
18:46 Kizor [moryok@Nightstar-e0a4sm.utu.fi] has joined #code
18:46 Pi [sid25146@Nightstar-7he56f.irccloud.com] has joined #code
18:46 jeroud [sid10043@Nightstar-6br85t.irccloud.com] has joined #code
18:46 Attilla [sid13723@Nightstar-h2b233.irccloud.com] has joined #code
18:46 ServerMode/#code [+aoooaooooooaoooaoooaoooooaoo [R] [R] Namegduf gnolam Reiver Reiver Tamber abudhabi Azash himi JustBob ToxicFrog ToxicFrog Alek Turaiel[Offline] jerith jerith macdjord celticminstrel McMartin McMartin iospace Kindamoody|afk crystalclaw Pi jeroud jeroud Attilla] by *.Nightstar.Net
19:07 ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has quit [Ping timeout: 121 seconds]
19:14 ion [Owner@Nightstar-gmbj85.vs.shawcable.net] has joined #code
21:19 Kindamoody|afk is now known as Kindamoody
23:10 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Mon Jun 19 00:00:18 2017
code logs -> 2017 -> Sun, 18 Jun 2017< code.20170617.log - code.20170619.log >

[ Latest log file ]