PacktPublishing / Build-Your-Own-Programming-Language

Build Your Own Programming Language, published by Packt
MIT License
200 stars 49 forks source link

Can't Find UFlex in Unicon Installation #1

Closed tajmone closed 2 years ago

tajmone commented 2 years ago

@cjeffery, first of all I'd like express my uttermost compliments for your book Build Your Own Programming Language — it's simply fantastic! And, I would like to add, it's one of the very few books on the subject which explores the topic in a truly pedagogical way for the non-academic reader, providing a good panoramic of the necessary steps to consider in approaching the task of designing a new programming language.

I was really glad when I discovered you opted to use Unicon as a language for the task at hand. I didn't know Unicon (nor Icon, for that matter) but as I keep reading on the book I can see why this was an excellent choice.

In "Ch.3 - Technical requirements" you wrote:

UFlex comes with Unicon and requires no separate installation.

I've download Unicon 13.2 for Windows, but I can't seem to find UFlex anywhere in the installation folder (searching the directory tree for a file named uflex doesn't match anything either).

The only tool that I could find was in the uni/unicon/ subfolder, a source file named unilex.icn which I managed to compile successfully, but the executable doesn't seem to provide any --help, so I'm not sure if that file is just part of Unicon compiler source or whether it's the same UFlex tool mentioned in the book.

Could you please help me find the UFlex tool mentioned in the book?


P.S.1 — I've found some typos and other errors I'd like to report. Can I use this repository Issues to do so? The online book at Packt doesn't mention any contact for reporting errata.

P.S.2 — Any chance you could enable Discussion in this repository? It would be useful to share readers experiences, ask questions, etc., and I'd love to leave a book review there too (Packt doesn't allow customers to leave books reviews).

tajmone commented 2 years ago

OK, I see that UFlex is to be found in the uni/ulex/ subfolder of the Unicon repository, but that folder is not included in the Windows distribution of Unicon.

I've tried compiling it myself, but since I have MSYS2 it failed. I can't install MYSYS and another version of GCC on my machine, since I already have MSYS2 (which I need for Ruby) and another global GCC (MinGW64) version (which I need for Rust and Nim), and I'd rather avoid potential conflicts (also, I'm not really interested in building Unicon from source right now, I'm just approaching this language).

Is there any chance that you could include in this repository a precompiled UFlex binary for Windows? (either in the repo itself, or as an attached resource somewhere, e.g. in the Wiki as a Zip archive, or in the Releases page).

That would be very helpful, since right now I'm stuck in the book, since I don't have access to UFlex.

Any reason why the UFlex executable is not included with Unicon for Windows?

cjeffery commented 2 years ago

Hi, thank you for your kind words. The uni/ulex directory contains an earlier lex for Unicon that is an unfinished student effort. uflex started as extensions to and then a translation of this code, and that directory may contain an early translation of that lex tool from C to Unicon that calls itself uflex, but it does not yet contain the later more finished version of uflex that I used for the book. I intend to put that into Unicon before the book's release on December 31 2021, and get uflex added to the Windows binary distribution, but have been slowed by other work obligations, and by the fact that I am still not satisfied with uflex in some respects. While developing the book, I provided uflex to technical reviewers via a source .zip downloaded from my university website. You can get an example of that at http://www.cs.nmt.edu/~jeffery/uflex-10-27-21.zip if you want. Very sorry that my Windows Unicon build is behind schedule.

tajmone commented 2 years ago

Got UFlex, Can't Find Iyacc!

@cjeffery, now I've got UFlex from the link you kindly provided me. But I'm having trouble finding the Iyacc tool.

The book says in Ch.4:

At the time of writing, the Windows BYACC/J binary distribution consists of a byaccj1.15_win32.zip file, which sounds old and contains one file named yacc.exe. There is no installer.

But there doesn't seem to be any Zip archive to that name (nor any file called "Iyacc" or "byaccj1").

Anywhere I can download this tool from?

cjeffery commented 2 years ago

Apologies for not seeing/replying earlier, I need to figure out how to tell this platform to forward posts to me by e-mail. Iyacc is included in Unicon source distributions and is supposed to be in binary distributions but wasn't. While waiting for official ones to be built that include it (and ulex), I put up a Unicon Windows binary distribution at http://www.cs.nmt.edu/~jeffery/setup-unicon_13.3-uflex-64bit.exe that I think includes both ulex and iyacc.

tajmone commented 2 years ago

Apologies for not seeing/replying earlier, I need to figure out how to tell this platform to forward posts to me by e-mail.

Since the repository is owned by Packt all email notifications to Issue by default should be sent to Packt publishing, so I mentioned you via your GitHub userID (@cjeffery), which should notify you in some way (depending on your settings).

I've also experienced problems with repositories Issues notifications some times in the past, then I revised my GitHub account settings for notifications to ensure that I will receive an email for any new Issues, Discussions and PRs (or replies therein) for any repository which I follow. As for notifications when your user-ID is mentioned via the @. I think that by default these notifications are just shown in your GitHub main user page, but there should be a dedicated setting to ensure that these notifications are forwarded by email too — in any case, they don't show up in the notifications bar (with the bell icon).