Arc Forumnew | comments | leaders | submitlogin
Arc3F released: Generic functions, base functions, scanners, symbol-based packages... (github.com)
16 points by almkglor 5925 days ago | 22 comments


4 points by almkglor 5925 days ago | link

This is the Arc fork I've been ranting about recently.

More stuff and commentary later.

No arc http server yet, arc http server will need to be ported somewhat due to symbol-based packages.

Need more docs.

Bye have to go to work now.

-----

2 points by almkglor 5925 days ago | link

Okay, many of the main differences are described here: http://arclanguage.com/item?id=8266

I'll be adding more text documents soon

-----

2 points by stefano 5924 days ago | link

I've got a problem with the symbol system: I want to use files.arc, but it uses the macro '$ to call mzscheme. The problem is that symbols passed to mzscheme are modified by the package system, so that ($ (mz-fun)) becomes ($ (<current-package>mz-fun)). This means that it's not possible to call mzscheme's 'mz-fun. Is there a way to make a symbol outside of the package system, i.e. '<>my-sym -> 'my-sym and not '<current-package>my-sym?

-----

3 points by almkglor 5924 days ago | link

$ probably needs to demangle names by applying 'unpkg on them.

  <User>tl: 'x
  <User>x
  <User>tl: (using <arc>v3-packages)
  t
  <User>tl: (unpkg 'x)
  x
For that matter, while reviewing arc.arc, I noticed that there are quite a few file-related functions already exported from mzscheme into arc-space. I suspect bits of files.arc can be rewritten to use those functions instead.

Personally I think it's better to do something like this:

  ($.mzscheme-function param1 param2)
Then we can simply define $ as:

  (mac $ (x)
    `(seval ',(<arc>unpkg x)))
edit: pushed a version of files.arc on arc-f. To use, just (using <files>v1)

-----

1 point by stefano 5923 days ago | link

Thanks. I've made my own working version of files.arc when I discovered 'unpkg, but I couldn't push it because I didn't have access to internet :(

Basically I implemented a version of '$ that automatically unpackages symbols except those given in a list.

-----

1 point by eds 5923 days ago | link

I'm having trouble loading Arc3F under Windows XP (using MzScheme 352). Normally, the following would for me with Anarki.

  C:\User\Programming\Arc\arc3f\arc-f>mzscheme -mf as.scm
  current-directory: expects argument of type <complete path or string>; given #f
Any ideas?

-----

1 point by almkglor 5923 days ago | link

It's a dependency on ./arc.sh

Specifically, arc.sh sets the environment variable "arc_dir" to the installation directory.

I would suggest making a batch file which sets the environment variable arc_dir properly before launching mzscheme -af as.scm ^^

Should probably be done correctly by providing an arc.bat I suppose, although the problem is always figuring out the installation directory... haven't hacked MSDOS batch files in a long time ^^

-----

3 points by eds 5922 days ago | link

Ok, I got arc3f to work with the following:

  C:\User\Programming\Arc\arc3f\arc-f>set arc_dir=C:\User\Programming\Arc\arc3f\arc-f

  C:\User\Programming\Arc\arc3f\arc-f>mzscheme -mf as.scm
  Compiling arc.arc...
  Use (quit) to quit, (tl) to return here after an interrupt.
  <User>tl:
Unfortunately, (having learned Unix shell scripting), I never bothered to learn Windows batch files.

Also of note, arc.sh doesn't work in Cygwin:

  $ sh arc.sh
  > default-load-handler: cannot open input file: "c:/cygdrive/c/User/Programming/Arc/arc3f/arc-f/as.scm" (The system cannot find the path specified.; errno=3)

-----

2 points by almkglor 5922 days ago | link

I pushed an untested arc.bat launcher on the anarki arc-f recently, although now that I've reviewed it it seems I used the wrong flag in the mzscheme invocation (-af instead of -mf). Could I ask you to check it out, and if so, could you check it out?

As for the cygwin stuff.... hmm. Maybe I should fix my broken WinXP machine...

-----

1 point by bOR_ 5920 days ago | link

   @echo off
   set arc_dir=C:\Program Files\ARCF
   mzscheme -mf "%arc_dir%\as.scm"
This one worked for me. I'm not sure if removing the [][]'s from the file and making it windows line breaks mattered, but at least I had to move some ""'s around to get it to work.

Now just trying to get the launch-an-arc-script script working (from outside the repl). The script that is elsewhere on the website works on linux, but not windows ;). Damn pipes.

-----

1 point by bOR_ 5919 days ago | link

  Use (quit) to quit, (tl) to return here after an interrupt.
  <User>tl: (load "arc-life.arc")
  Error: "reference to undefined identifier: __<arc>car_"

Hmm. I might be doing something wrong with trying to load an arc file in ARCF.

-----

2 points by almkglor 5918 days ago | link

Hmm. Looks like a bug in some macro in Arc-F. Will find. Off the top, I can't seem to find any problems; a file like this:

  (prn "foo")
...loads fine:

  Use (quit) to quit, (tl) to return here after an interrupt.
  <User>tl: (load "test.arc")
  foo
  nil
  <User>tl:
care to send me the source you have? almkglor@gmail.com

-----

1 point by eds 5919 days ago | link

That batch file works, thanks!

-----

1 point by almkglor 5919 days ago | link

Out of curiousity: does it work even if you're on a different hard drive/directory as the installation drive/directory? The intent of that batch file is to allow you to launch Arc from anywhere, while still (1) able to access the current directory and (2) able to load library files from the arc installation directory

-----

1 point by eds 5918 days ago | link

Yes, the batch file loads fine from another drive letter.

  E:\>"C:\User\Programming\Arc\arc3f\arc-f\arc.bat"
  Use (quit) to quit, (tl) to return here after an interrupt.
  <User>tl:
That said, I am not sure how to test that it can load files in both directories... especially with the new behavior of 'using.

-----

1 point by almkglor 5918 days ago | link

Try on different directory:

  E:\> copy con tmp.arc
  (prn "hello world!")
  ^Z                       <---- that's a control-Z
  E:\> "C:\User\Programming\Arc\arc3f\arc-f\arc.bat"
  Use (quit) to quit, (tl) to return here after an interrupt.
  <User>tl: (using <files>v1)
  t
  <User>tl: (ls)
  ("tmp.arc")       <--- you should get a list of files and stuff in the current directory, including tmp.arc
  <User>tl: (load "tmp.arc")
  hello world!
  nil
  <User>tl:

-----

1 point by eds 5910 days ago | link

Works perfectly :-)

-----

2 points by stefano 5925 days ago | link

I've already said it in the forum, but it is worth repeating: well done!

-----

1 point by stefano 5917 days ago | link

I think it's quite confusing to have two different (and incompatible) implementations of Arc in the same repository. What do you think about moving arc-f in a different repository?

-----

1 point by almkglor 5917 days ago | link

I could, if only I could figure out how to automatically give write access to the repository to everyone, the way Anarki is always write-accessible to everyone. T.T Bit of a hassle to have people request for access and then have to grant it to them.

-----

1 point by stefano 5925 days ago | link

I've noticed that arc-f boots in half the time of anarki. Is that because it loads less things on startup?

-----

3 points by almkglor 5924 days ago | link

Yes. I don't intend to have html.arc, user.arc and asv.arc to load on startup, instead, I expect the user to have to explicitly do:

  (using <asv>v1)
....which will load asv.arc, and asv.arc will then have dependencies on <html>v1 and <user>v1. If you have an app that needs <asv>v1, then put the (using <asv>v1) declaration in your app's source.

After all, not everyone will use Arc for web apps ^^

edit:

Also, as.scm attempts to precompile arc.arc into a scheme file. It loads those faster. I'm wondering if it would be possible to integrate the precompilation so that any 'using metacommand will precompile all libraries, just for the faster load times.

It would probably be better too to figure out what mzscheme's equivalent to fasl files is, and target that instead of just a .scm file.

-----