arc3 is a major change from arc2, with about 3000 lines and most files changed. The following gratuitous pie chart illustrates that the largest number of changes are in the news server (news.arc), with many changes to the fundamental language (ac.scm and arc.arc) as well as the web and application servers (app.arc and srv.arc).
The news server has been heavily modified with new ranking, support for polls, and improved spam rejection, among other features. A new "how-to-run-news" file explains how to set up your own Hacker News-like server. I will discuss the news server, web server, app server, and html library in more detail in a future article. I will focus this article on the language and main libraries.
If you're looking to try arc3, it can be downloaded here. Arc3 has significant incompatibilities with previous versions that will cause problems if you're not prepared.
- Arc now requires mzscheme 372. Arc will not work with the version 352 required by arc2, or with the newer versions of mzscheme.
flush-outputis disabled by default on
disp, and functions that use these. See
- The result of accum is no longer in reverse order.
news.arcis no longer loaded as part of arc.
((a b) c), not
(a b c)
((a 'b) 'c), not
(a 'b 'c)
setfunction has been renamed
assign, and the
assertfunction has been renamed
flatno longer supports
intfunction coerces to an integer.
force-closediscards buffered output and closes the descriptor.
mvfilemoves a file.
memoryreturns the current memory use.
logare finally available.
declareis used to set system variables:
explicit-flushto control automatic output flushing, and
direct-callsfor the function call optimization.
timedateconverts seconds to date.
copylistcopies a list.
defto name, args, body triples to define multiple functions at once.
getprovides simpler table / array lookup.
get!foocreates a function that takes a table and looks up
'foo. (Actually, it's a generic mechanism to create a function to apply an argument to something.)
writefilewrites to a temporary file first.
lettertests if a character is a letter.
sumsums up function results.
medreturns median of list.
minutes-sincereturns minutes since a time.
cacheto reduce boilerplate.
datestringcreates "y - m - d" string.
or=modifies a variable if the variable is false.
outevaluates and prints an expression.
todiskprovide a simplified mechanism for loading and storing data.
halvesplits a string in two on the first separator.
positionsreturns a list of positions where a test is true.
linessplits a string into lines.
urlencodeurlencodes a string.
nonblankreturns a string if it's nonblank.
pluralreturns a count and pluralized word.
socket-acceptuses custodians so web servers can forcibly close connections if the clients aren't reading data.
coerceof string into int rounds the value as does number to char.
listmodified to copy the list.
safesetnow writes warnings to stderr.
eachfixed to avoid conflict with
rand-stringnow more random to help fix huge security hole.
splitfixed for negative positions..
readlinewill terminate on
datefixed to avoid system operation.
interspersenow works with
numfixed to handle negative numbers.
complementin function position
+operations when applied to two arguments.
(foo bar)is optimized to call
foois a global bound to a function. This is controlled by
- Debugging has been improved by giving the Arc names of things to Scheme, and turning on line counting.
- A default value can be provided when accessing a hash table.
- Currying was largely implemented but not enabled.
Disclaimers: I have provided my interpretations of the changes in arc3, and I'm sure there are some errors; please provide feedback if you find mistakes. Note that I am not connected with the arc team in any way, and this is not an "official" list of changes. In addition, arc3 may change without warning, so any of the above can be obsoleted. (There are some good reasons for real version numbers, bug tracking, and source code control, but I won't belabor that point.)