I was doing a deep-`iso` comparison I called `same`, because in Arc, hash tables are not the same. In Arc3.1:
arc> (iso (obj) (obj))
nil
arc> (iso (obj 1 2) (obj 1 2))
nil
So I made a function that iterated over the key/value pairs and compared them. In some unit tests, I used that on a hash table that contained functions. Yesterday, I refactored the unit tests to instead make sure the keys were right.
Interestingly, it seems that Anarki can compare hash tables:
arc> (iso (obj) (obj))
't
arc> (iso (obj 1 2) (obj 1 2))
't
Anyway, this should fix the unit test tests in the Anarki repo.
At one point, years ago, I relied on every lambda returning a newly allocated object. I think I brought it up as a bug in Rainbow that the [] expressions in my Arc code were generating the same lambda-lifted result instead of creating unique objects each time.
But I think this was never something I could rely on in the original, Racket-based Arc either. The Racket docs don't specify whether a lambda expression returns a new object or reuses an existing one, and in fact they explicitly allow for the possibility of reusing one:
"Similarly, evaluation of a lambda form typically generates a new procedure object, but it may re-use a procedure object previously generated by the same source lambda form."
That sentence has been in the reference since the earliest versions I can find online:
I'm not sure if the bug you're referring to had to do with making the same mistake I was making back then, or if you're talking about making the opposite assumption (expecting two procedures to be equal), but it's probably best not to expect stability either way.
Hrm. The tests definitely were faster. They weren't as fast as I'd wanted, but certainly not this slow. It just took three minutes for me to load that file. It's slightly complicated by that file loading _and_ running the tests, but again, it wasn't that slow before. For reference, I'm on Ubuntu running Racket 8.1.
One thing that definitely has changed is that now, Anarki requires Racket >=7.7. I just had to update my Racket from 7.2, which worked the last time I ran Anarki, Perhaps this is related?
Thanks for checking in. The dates of the files in the directories is 2018. I downloaded recent version and gave it a spin: It took about a minute to start up and then I ran (app-start "news") and it started the news app.
There are a number of system calls like (system "rm ...") in news.arc and other places. These run shell commands, and most of them only work on a POSIX shell. I'm sorry to say, I'm not sure anyone has ever gone through all these calls and made them portable so that news.arc can run on Windows.
If you use the Anarki master branch, I think a few of those calls have been replaced with more portable code, but not all of them. I've at least been able to get a server started up and showing content before.
I used to use Arc on Windows quite a bit, and I tried the web server a couple of times, but I never really used the web server. Nowadays I still use Windows, but I do a lot of my programming projects inside a Linux Mint VM using VirtualBox. I think running news.arc inside a VM like that would be one of the easier ways to get it working. Of course, learning to set up a VM like that could be a lot to figure out, but at least that's something a lot of people out there have already written up tutorials for.
Another possibility is to look for one of the many Hacker News clones that people have whipped up in other languages. You probably won't get to use Arc that way, but some of those clones may be better architected and better maintained than news.arc.
I ran (load "news.arc") this time and it prints out a list of items prefixed with * redefining and 'nil' returns after the last item.
However, nothing happens at localhost8080 and when I run (nsv) it gives this message:
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
'rm' is not recognized as an internal or external command,
operable program or batch file.
load items: Error: "directory-list: could not open
directory\n path: C:\\Users\\Hopet Ma'at
Amun\\Desktop\\arc3.2\\arc\\news\\story\\\n system error:
The system cannot find the path specified.; win_err=3"
I got it set up in the regular terminal by adding the path to environment variables, however, it gave me the same message as before. Is there something more I should be doing with the untarred folder, maybe?
Yes, I have experience programming from years ago and recently started learning Python until I happened across Arc. I think it's neat and would be great for my project. Where is the how-to-run news in case I don't find it myself? Thanks