Software regression issues with the new tools

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Software regression issues with the new tools

dolomiti7
The recently updated nand2tetris.zip (Nov 30, 2023) seems to be based on an already outdated version of the tools and consequently introduced a few regression bugs.

After quickly reviewing the file, I found the following:
1. Provided OS: (folder tools/OS)
- Sys.vm is the old version from 2016. The issue here is that Sys.err contains a call to String.new which results in a call to Memory.alloc. In case of a memory allocation error, this can lead to an endless loop instead  of printing out the error code. This was fixed in the 2018 version, which called 3 times consecutively Output.printChar instead of creating a new String for "ERR". (filesize 1309 vs 1267)
- Memory.vm is also the old version from 2016, using a inferior memory management algorithm. Before that, there was a version from 2018 with an improved algorithm (filesize 3682 vs 4920). Not really a bug, but still a regression.

2. Memory Test (project 12)
- The more advanced MemoryDiag test is now missing (was introduced in 2018 in a subfolder of MemoryTest)

3. Project 10 Square
- The Main.Jack file doesn't correspond with the XML file. It seems to be the Main.jack from the ArrayTest folder of project 10.

Not sure if there are other issues, but I would strongly suggest to review the release and reconcile with the previous version.

@WBahn could you please highlight to the authors.
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Software regression issues with the new tools

dolomiti7
Also I find some of the old explanatory comments in the HDL files clearer, but that is just a personal preference.

Example from Xor.hdl, previously:
/**
 * Exclusive-or gate:
 * out = not (a == b)
 */


versus now:
/**
 * Exclusive-or gate:
 * out = (((a == 0) & (b = 1)) | ((a == 1) & (b = 0)), 1, 0)
 */
Reply | Threaded
Open this post in threaded view
|

Re: Software regression issues with the new tools

WBahn
Administrator
In reply to this post by dolomiti7
@WBahn could you please highlight to the authors.
Thanks
I've passed a note onto the authors. Given everything going on in that part of the world, not to mention the time of year, I don't know how quickly they will be able to get to it.<quote author="dolomiti7">
The recently updated nand2tetris.zip (Nov 30, 2023) seems to be based on an already outdated version of the tools and consequently introduced a few regression bugs.

Reply | Threaded
Open this post in threaded view
|

Re: Software regression issues with the new tools

WBahn
Administrator
In reply to this post by dolomiti7
dolomiti7 wrote
Also I find some of the old explanatory comments in the HDL files clearer, but that is just a personal preference.

Example from Xor.hdl, previously:
/**
 * Exclusive-or gate:
 * out = not (a == b)
 */


versus now:
/**
 * Exclusive-or gate:
 * out = (((a == 0) & (b = 1)) | ((a == 1) & (b = 0)), 1, 0)
 */
I would tend to agree. The problem I see with the old description is that a lot of readers use those expressions as though they represent a direct mapping to how to implement the logic, and there's nothing available to implement (a == b), so they get stumped.

But the new version is confusing on a few fronts. First, it uses both '==' and '=' in the same expression, implying that the distinction is important.

Second, the interpretation of the syntax (a,b,c) is not clear (I don't know if it is defined anywhere). This seems to be patterned after the C conditional (ternary) operator (which Java does support).

Given the information provided by Fig 1.7 of the 2nd edition, I don't think it would be giving to much away to just give the blueprint patterned there:

 * out = (not(a) and b) or (a and not(b))