Forum comments in chronological order
Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.
Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.
- Jun 2007
- Aug 2007
- Oct 2007
- Nov 2007
- Dec 2007
- Jan 2008
- Feb 2008
- Mar 2008
- Apr 2008
- May 2008
- Jun 2008
- Jul 2008
- Aug 2008
- Sep 2008
- Oct 2008
- Nov 2008
- Dec 2008
- Jan 2009
- Feb 2009
- Mar 2009
- Apr 2009
- May 2009
- Jun 2009
- Jul 2009
- Aug 2009
- Sep 2009
- Oct 2009
- Nov 2009
- Dec 2009
- Jan 2010
- Feb 2010
- Mar 2010
- Apr 2010
- May 2010
- Jun 2010
- Jul 2010
- Aug 2010
- Sep 2010
- Oct 2010
- Nov 2010
- Dec 2010
- Jan 2011
- Feb 2011
- Mar 2011
- Apr 2011
- May 2011
- Jun 2011
- Jul 2011
- Aug 2011
- Sep 2011
- Oct 2011
- Nov 2011
- Dec 2011
- Jan 2012
- Feb 2012
- Mar 2012
- Apr 2012
- May 2012
- Jun 2012
- Jul 2012
- Aug 2012
- Sep 2012
- Oct 2012
- Nov 2012
- Dec 2012
- Jan 2013
- Feb 2013
- Mar 2013
- Apr 2013
- May 2013
- Jun 2013
- Jul 2013
- Aug 2013
- Sep 2013
- Oct 2013
- Nov 2013
- Dec 2013
- Jan 2014
- Feb 2014
- Mar 2014
- Apr 2014
- May 2014
- Jun 2014
- Jul 2014
- Aug 2014
- Sep 2014
- Oct 2014
- Nov 2014
- Dec 2014
- Jan 2015
- Feb 2015
- Mar 2015
- Apr 2015
- May 2015
- Jun 2015
- Jul 2015
- Aug 2015
- Sep 2015
- Oct 2015
- Nov 2015
- Dec 2015
- Jan 2016
- Feb 2016
- Mar 2016
- Apr 2016
- May 2016
- Jun 2016
- Jul 2016
- Aug 2016
- Sep 2016
- Oct 2016
- Nov 2016
- Dec 2016
- Jan 2017
- Feb 2017
- Mar 2017
- Apr 2017
- May 2017
- Jun 2017
- Jul 2017
- Aug 2017
- Sep 2017
- Oct 2017
- Nov 2017
- Dec 2017
- Jan 2018
- Feb 2018
- Mar 2018
- Apr 2018
- May 2018
- Jun 2018
- Jul 2018
- Aug 2018
- Sep 2018
- Oct 2018
- Nov 2018
- Dec 2018
- Jan 2019
- Feb 2019
- Mar 2019
- Apr 2019
- May 2019
- Jun 2019
- Jul 2019
- Aug 2019
- Sep 2019
- Oct 2019
- Nov 2019
- Dec 2019
- Jan 2020
- Feb 2020
- Mar 2020
- Apr 2020
- May 2020
- Jun 2020
- Jul 2020
- Aug 2020
- Sep 2020
- Oct 2020
- Nov 2020
- Dec 2020
- Jan 2021
- Feb 2021
- Mar 2021
- Apr 2021
- May 2021
- Jun 2021
- Jul 2021
- Aug 2021
- Sep 2021
- Oct 2021
- Nov 2021
- Dec 2021
- Jan 2022
- Feb 2022
- Mar 2022
- Apr 2022
- May 2022
- Jun 2022
- Jul 2022
- Aug 2022
- Sep 2022
- Oct 2022
- Nov 2022
- Dec 2022
- Jan 2023
- Feb 2023
- Mar 2023
- Apr 2023
- May 2023
- Jun 2023
- Jul 2023
- Aug 2023
- Sep 2023
- Oct 2023
- Nov 2023
- Dec 2023
- Jan 2024
- Feb 2024
- Mar 2024
- Apr 2024
- May 2024
- Jun 2024
- Jul 2024
- Aug 2024
- Sep 2024
- Oct 2024
- Nov 2024
Sep 2019
Anonymous
Tue 10-Sep-2019 11:31
Tue 10-Sep-2019 11:31
Fantastic, and well deserved. Every part of Dialog oozes quality. —Thore
Anonymous
Mon 16-Sep-2019 11:52
Mon 16-Sep-2019 11:52
I just tried a hello world example and segfaulted the compiler (Dialog, release 0h/02, library 0.30, prebuilt for Linux x64)
$ cat test.dg
(story ifid) B0E2A7D1-45F7-46A1-8348-53ADA71F2CD8
(program entry point)
We'll find out how this works, slowly.
$ valgrind dialogc test.dg
==14539== Memcheck, a memory error detector
==14539== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14539== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==14539== Command: dialogc test.dg
==14539==
==14539== Invalid read of size 1
==14539== at 0x12A4FA: addstr_escape.constprop.1 (in /usr/local/bin/dialogc)
==14539== by 0x12AE3D: emit_blorb (in /usr/local/bin/dialogc)
==14539== by 0x129FF1: backend_z (in /usr/local/bin/dialogc)
==14539== by 0x10D487: main (in /usr/local/bin/dialogc)
==14539== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14539==
==14539==
==14539== Process terminating with default action of signal 11 (SIGSEGV)
==14539== Access not within mapped region at address 0x0
==14539== at 0x12A4FA: addstr_escape.constprop.1 (in /usr/local/bin/dialogc)
==14539== by 0x12AE3D: emit_blorb (in /usr/local/bin/dialogc)
==14539== by 0x129FF1: backend_z (in /usr/local/bin/dialogc)
==14539== by 0x10D487: main (in /usr/local/bin/dialogc)
==14539== If you believe this happened as a result of a stack
==14539== overflow in your program's main thread (unlikely but
==14539== possible), you can try to increase the size of the
==14539== main thread stack using the --main-stacksize= flag.
==14539== The main thread stack size used in this run was 8388608.
==14539==
==14539== HEAP SUMMARY:
==14539== in use at exit: 613,930 bytes in 657 blocks
==14539== total heap usage: 1,170 allocs, 513 frees, 1,450,866 bytes allocated
==14539==
==14539== LEAK SUMMARY:
==14539== definitely lost: 7,600 bytes in 50 blocks
==14539== indirectly lost: 206,966 bytes in 102 blocks
==14539== possibly lost: 0 bytes in 0 blocks
==14539== still reachable: 399,364 bytes in 505 blocks
==14539== suppressed: 0 bytes in 0 blocks
==14539== Rerun with --leak-check=full to see details of leaked memory
==14539==
==14539== For counts of detected and suppressed errors, rerun with: -v
==14539== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
$ cat test.dg
(story ifid) B0E2A7D1-45F7-46A1-8348-53ADA71F2CD8
(program entry point)
We'll find out how this works, slowly.
$ valgrind dialogc test.dg
==14539== Memcheck, a memory error detector
==14539== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14539== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==14539== Command: dialogc test.dg
==14539==
==14539== Invalid read of size 1
==14539== at 0x12A4FA: addstr_escape.constprop.1 (in /usr/local/bin/dialogc)
==14539== by 0x12AE3D: emit_blorb (in /usr/local/bin/dialogc)
==14539== by 0x129FF1: backend_z (in /usr/local/bin/dialogc)
==14539== by 0x10D487: main (in /usr/local/bin/dialogc)
==14539== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14539==
==14539==
==14539== Process terminating with default action of signal 11 (SIGSEGV)
==14539== Access not within mapped region at address 0x0
==14539== at 0x12A4FA: addstr_escape.constprop.1 (in /usr/local/bin/dialogc)
==14539== by 0x12AE3D: emit_blorb (in /usr/local/bin/dialogc)
==14539== by 0x129FF1: backend_z (in /usr/local/bin/dialogc)
==14539== by 0x10D487: main (in /usr/local/bin/dialogc)
==14539== If you believe this happened as a result of a stack
==14539== overflow in your program's main thread (unlikely but
==14539== possible), you can try to increase the size of the
==14539== main thread stack using the --main-stacksize= flag.
==14539== The main thread stack size used in this run was 8388608.
==14539==
==14539== HEAP SUMMARY:
==14539== in use at exit: 613,930 bytes in 657 blocks
==14539== total heap usage: 1,170 allocs, 513 frees, 1,450,866 bytes allocated
==14539==
==14539== LEAK SUMMARY:
==14539== definitely lost: 7,600 bytes in 50 blocks
==14539== indirectly lost: 206,966 bytes in 102 blocks
==14539== possibly lost: 0 bytes in 0 blocks
==14539== still reachable: 399,364 bytes in 505 blocks
==14539== suppressed: 0 bytes in 0 blocks
==14539== Rerun with --leak-check=full to see details of leaked memory
==14539==
==14539== For counts of detected and suppressed errors, rerun with: -v
==14539== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
Anonymous
Mon 16-Sep-2019 11:57
Mon 16-Sep-2019 11:57
This seems to be linked to the (default) zblorb format. The others work fine.
Anonymous
Tue 17-Sep-2019 19:42
Tue 17-Sep-2019 19:42
hackernews sent me here
Anonymous
Tue 17-Sep-2019 19:46
Tue 17-Sep-2019 19:46
Q is dead...#Anastasius
Anonymous
Tue 17-Sep-2019 21:23
Tue 17-Sep-2019 21:23
hackernews sent me here
so what?lft
Linus Åkesson
Wed 18-Sep-2019 10:44
Linus Åkesson
Wed 18-Sep-2019 10:44
I just tried a hello world example and segfaulted the compiler (Dialog, release 0h/02, library 0.30, prebuilt for Linux x64)
Thanks for reporting it!
This appears to happen for small input (i.e. without the standard library), in combination with the zblorb format. I'll fix it tonight. Meanwhile, either switch to the z8 format or include the standard library.
lft
Linus Åkesson
Thu 19-Sep-2019 06:01
Linus Åkesson
Thu 19-Sep-2019 06:01
I just tried a hello world example and segfaulted the compiler (Dialog, release 0h/02, library 0.30, prebuilt for Linux x64)
This is now fixed in 0h/03.
Anonymous
Mon 23-Sep-2019 12:13
Mon 23-Sep-2019 12:13
Using dialogc-0h03:
The following program crashes the compiler, regardless of the output format. It works on version 0d02.
(program entry point)
(now) ~($ has parent $)
Error messages:
backend_z.c:2010: generate_code: Assertion `ci->oper[0].value != DYN_HASPARENT' failed.
and
backend_aa.c:1350: compile_routines: Assertion `ci->oper[0].value != DYN_HASPARENT' failed.
--------------------------------------------------------
The following three programs crash the compiler when compiling for the Aa-machine but work fine on the Z-machine:
(program entry point)
(#a = $X)
Error message:
backend_aa.c:752: encode_dest: Assertion `0' failed.
--------------------------------------------------------
Note: I have been unable to minimize this program further because removing any line will cause the crash to disappear.
(program entry point)
($x = 3)
($y = 3)
($ = $)
([#a #b] = [#a #b])
([#a #b] = [#b #a])
([1 [@a] 3] = [1 [@a] 3])
([1 [@a #b] 3] = [2 [@a #b] 3])
([1 [@a #b] 3] = [1 [@a #b] 3])
([1 2 3 4] = [$a $b $c $d])
Error message:
backend_aa.c:3151: opersize: Assertion `aao.value <= 0x3f' failed.
--------------------------------------------------------
And a similar program, also as simplified as possible:
(program entry point)
($x = 3)
($y = 3)
($ = $)
([#a] = [])
([#a #b] = [#a #b])
([#a #b] = [#b #a])
([1 [#a #b] 3] = [1 [#a #b] 3])
([1 [#a #b] 3] = [2 [#a #b] 3])
([1 [#a #b] 3] = [1 [#a #b] 3])
([1 [#a #b] 3] = [1 [#a] 3])
Error message:
backend_aa.c:3151: opersize: Assertion `aao.value <= 0x3f' failed.
The following program crashes the compiler, regardless of the output format. It works on version 0d02.
(program entry point)
(now) ~($ has parent $)
Error messages:
backend_z.c:2010: generate_code: Assertion `ci->oper[0].value != DYN_HASPARENT' failed.
and
backend_aa.c:1350: compile_routines: Assertion `ci->oper[0].value != DYN_HASPARENT' failed.
--------------------------------------------------------
The following three programs crash the compiler when compiling for the Aa-machine but work fine on the Z-machine:
(program entry point)
(#a = $X)
Error message:
backend_aa.c:752: encode_dest: Assertion `0' failed.
--------------------------------------------------------
Note: I have been unable to minimize this program further because removing any line will cause the crash to disappear.
(program entry point)
($x = 3)
($y = 3)
($ = $)
([#a #b] = [#a #b])
([#a #b] = [#b #a])
([1 [@a] 3] = [1 [@a] 3])
([1 [@a #b] 3] = [2 [@a #b] 3])
([1 [@a #b] 3] = [1 [@a #b] 3])
([1 2 3 4] = [$a $b $c $d])
Error message:
backend_aa.c:3151: opersize: Assertion `aao.value <= 0x3f' failed.
--------------------------------------------------------
And a similar program, also as simplified as possible:
(program entry point)
($x = 3)
($y = 3)
($ = $)
([#a] = [])
([#a #b] = [#a #b])
([#a #b] = [#b #a])
([1 [#a #b] 3] = [1 [#a #b] 3])
([1 [#a #b] 3] = [2 [#a #b] 3])
([1 [#a #b] 3] = [1 [#a #b] 3])
([1 [#a #b] 3] = [1 [#a] 3])
Error message:
backend_aa.c:3151: opersize: Assertion `aao.value <= 0x3f' failed.
lft
Linus Åkesson
Mon 23-Sep-2019 21:36
Linus Åkesson
Mon 23-Sep-2019 21:36
Thanks! I'll look into these. The first two are corner cases that I hadn't thought of; they should be easy to fix.
The last two happen because the compiler is running out of registers for holding temporary values. Fixing this involves a more substantial implementation effort that I've been putting off. But it needs to be done, of course.
The last two happen because the compiler is running out of registers for holding temporary values. Fixing this involves a more substantial implementation effort that I've been putting off. But it needs to be done, of course.
Anonymous
Tue 24-Sep-2019 03:54
Tue 24-Sep-2019 03:54
lucid explanation. much makes sense on terminals in stevens/kerrisk linux api guide
thanks!
thanks!
Anonymous
Mon 30-Sep-2019 12:12
Mon 30-Sep-2019 12:12
Amazing work Linus. I'm especially impressed at how you're proficient with coding, music and graphics all in one.
Just one question. Is the BASIC bootstrap part only necessary because of the competition rules? The Revision rules say "No autostart or assembler jumps/SYS". I guess that rule just means your program needs to be launchable by LOAD, RUN not LOAD, SYS?
Just one question. Is the BASIC bootstrap part only necessary because of the competition rules? The Revision rules say "No autostart or assembler jumps/SYS". I guess that rule just means your program needs to be launchable by LOAD, RUN not LOAD, SYS?
Anonymous
Mon 30-Sep-2019 13:50
Mon 30-Sep-2019 13:50
I have found several possible mistakes in the Aa-machine specification 0.2:
Important differences between the specification and the JS reference implementation:
- IF_FLAG, IFN_FLAG, SET_FLAG, and RESET_FLAG: "1 <<" should be "0x8000 >>" (that is, the spec starts shifting from the least-significant bit, but the ref impl starts shifting from the most-significant bit)
- JMPL_MULTI: "SIM = 0" should be "SIM = 0xffff"
- JMP_TAIL: "SIM < 0x8000" should be "SIM >= 0x8000"
- UNLINK, SET_PARENT: seven occurrences of "value - 1" should be "value" (the ref impl never subtracts 1 from those object values, not even in fieldaddr() or unlink())
- LOAD_VAL: the result of get_longterm() should not be stored in arg3 if it is zero (that is, according to the spec "arg3 <- get_longterm(...)" is executed even if "!arg3" is true; a solution might be to introduce a local variable)
Minor things:
- IF_CWL, IFN_CWL: use "arg2" even though there is only one argument
- STORE_WORD, STORE_BYTE, STORE_VAL, SET_FLAG, RESET_FLAG, UNLINK, IF_MEM_EQ, IFN_MEM_EQ, IF_FLAG, IFN_FLAG: opcode index lists first argument as "VALUE/0", but opcode details have "0/VALUE"
- unbox_int(): "v.tag != integer" should be "v.tag != number" (this is the only occurrence of "integer" as a tag type)
- store_longterm(), push_longterm(): "HEAP.ramsz" should be "HEAD.ramsz"
Suggestions:
- The initial state of the special-purpose registers is never defined (except for INST, though even that is somewhat hidden)
- FIELD_PARENT (=0), FIELD_CHILD (=1), FIELD_SIBLING (=2) are never defined
- It would be useful if pseudo-code invocations of runtime_error() explicitly defined the error_code (as it is probably not meant to be implementation-defined)
- input_get_line() is never defined (according to the Dialog manual this function works in a very specific way, so it is probably better to explicitly define it in the spec instead of leaving it up to the implementation)
Important differences between the specification and the JS reference implementation:
- IF_FLAG, IFN_FLAG, SET_FLAG, and RESET_FLAG: "1 <<" should be "0x8000 >>" (that is, the spec starts shifting from the least-significant bit, but the ref impl starts shifting from the most-significant bit)
- JMPL_MULTI: "SIM = 0" should be "SIM = 0xffff"
- JMP_TAIL: "SIM < 0x8000" should be "SIM >= 0x8000"
- UNLINK, SET_PARENT: seven occurrences of "value - 1" should be "value" (the ref impl never subtracts 1 from those object values, not even in fieldaddr() or unlink())
- LOAD_VAL: the result of get_longterm() should not be stored in arg3 if it is zero (that is, according to the spec "arg3 <- get_longterm(...)" is executed even if "!arg3" is true; a solution might be to introduce a local variable)
Minor things:
- IF_CWL, IFN_CWL: use "arg2" even though there is only one argument
- STORE_WORD, STORE_BYTE, STORE_VAL, SET_FLAG, RESET_FLAG, UNLINK, IF_MEM_EQ, IFN_MEM_EQ, IF_FLAG, IFN_FLAG: opcode index lists first argument as "VALUE/0", but opcode details have "0/VALUE"
- unbox_int(): "v.tag != integer" should be "v.tag != number" (this is the only occurrence of "integer" as a tag type)
- store_longterm(), push_longterm(): "HEAP.ramsz" should be "HEAD.ramsz"
Suggestions:
- The initial state of the special-purpose registers is never defined (except for INST, though even that is somewhat hidden)
- FIELD_PARENT (=0), FIELD_CHILD (=1), FIELD_SIBLING (=2) are never defined
- It would be useful if pseudo-code invocations of runtime_error() explicitly defined the error_code (as it is probably not meant to be implementation-defined)
- input_get_line() is never defined (according to the Dialog manual this function works in a very specific way, so it is probably better to explicitly define it in the spec instead of leaving it up to the implementation)
lft
Linus Åkesson
Mon 30-Sep-2019 23:00
Linus Åkesson
Mon 30-Sep-2019 23:00
I have found several possible mistakes in the Aa-machine specification 0.2
Thank you very much! I was aware of a few of these issues, because I've started to work on a second implementation (in 6502 assembler) based on the specification document, but I didn't realize that somebody else was having a detailed look at it too. I should make a 0.3 that fixes the errors, without adding any new features.
Also, for what it's worth, the current Dialog compiler never emits AUX_POP_VAL, and I'm thinking about deprecating that instruction. But it ought to remain in the specification until it's time to increment the major version number.