Arc Forumnew | comments | leaders | submit | ncommentslogin
1.

Thanks! I'll check this out later.
2.

I struggled to install it on my own too, but GPT 4 fixed that issue splendidly. I highly recommend you try: create a free account on chat.openai.com if you haven't already (GPT 3.5 is free, GPT 4 costs $20/mo), and then give it a prompt similar to this:

"Help me understand how to install arc. When I try to install in racket it says:

racket: undefined; cannot reference an identifier before its definition >"

Here's how I used it for my own issues:

https://i.imgur.com/JBHDQt2.png

3.

thanks for your reply, it's saying this:

    initializing arc.. (may take a minute)
    serving from C:\Users\user\anarki\apps\news
    starting app news
    load items:
    ranking stories.
    ready to serve port 8080

    To quit:
      arc> (quit)
      (or press ctrl and 'd' at once)
    For help on say 'string':
      arc> (help string)
    For a list of differences with arc 3.2:
      arc> (incompatibilities)
    To run all automatic tests:
      $ ./arc.sh
      arc> (load "tests.arc")

    If you have questions or get stuck, come to http://arclanguage.org/forum.
    Arc 3.2 documentation: https://arclanguage.github.io/ref.
    arc>
4.
3 points by capableweb 1580 days ago | link | parent | on: Latest source?

Read around a bit and found a community maintained fork which seems to be a bit more updated (https://github.com/arclanguage/anarki), is that what people tend to use?
5.

Getting back after arc is not the problem; even if I didn't have cd history set up a simple `cd -` would handle that.

Simple problem: I have a file containing a program written in Arc. I want to run it from the shell. How do I do that? I can fire up arc and `(load)` the file, but then the file needs to be in the arc2.3 dir or else I have to load it by absolute path, even if I was just in the same directory it's in.

For now I've just switched to using Anarki; I can run its `arc.sh` start script from anywhere in the filesystem and feed it a locally-relative pathname and it will run. Although it does seem to take quite a lot longer to start up than arc.

6.
2 points by daviddh 1769 days ago | link | parent | on: Is the sort function broken in 3.2?

Thanks for investigating this issue. I'm using Racket 8.2. I'll check out the community version you referenced.
7.

Ok, thanks
8.

I have found this and it looks promising. https://coderrocketfuel.com/courses/hacker-news-clone

My only concern is that it won't use the news.arc algorithm. In that case, I think I'd take the time to learn how to set up a virtual environment.

9.

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"
10.

I run this code and check http://localhost:8080/ but nothing loads.

  arc> load "news.arc"
 
  #<procedure: load>

  arc> "news.arc"
  
  arc> nsv

  #<procedure:zz>
11.
2 points by Jonesk79 1861 days ago | link | parent | on: Arc Installation

You're a great help, thanks! I was typing in Racket before racket -f as.scm, when I don't need to
12.
2 points by Jonesk79 1861 days ago | link | parent | on: Arc Installation

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?
13.

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
14.
2 points by Jonesk79 1862 days ago | link | parent | on: Arc Installation

After running the command, I get the following:

  > racket -f as.scm

  ; racket: undefined;

  ;  cannot reference an identifier before its definition

  ;   in module: top-level

  ; [,bt for context]

  > ; -f: undefined;

  ;  cannot reference an identifier before its definition

  ;   in module: top-level

  ; [,bt for context]

  > ; as.scm: undefined;

  ;  cannot reference an identifier before its definition

  ;   in module: top-level

  ; [,bt for context]
I think I have to somehow cd to the untarred arc3.2 but I'm not sure how to do so in the Racket App Terminal
15.
3 points by svk 1872 days ago | link | parent | on: Arc Installation

Thank you so much, zck :) I've used a combination of your helpful suggestions, stack overflow, and cd command to get to the right folder, and now it works. I got the arc command prompt (arc>) in my terminal now. I will take my time to explore the tutorial on Arc. I feel good that this community is really helpful. Thanks everyone!
16.
2 points by svk 1873 days ago | link | parent | on: Arc Installation

I downloaded and installed racket as described on arc installation page, and I got DrRacket version 8.0. The DrRacket window says: "Welcome to DrRacket, version 8.0 [cs]. Language: No language chosen; memory limit: 128 MB. DrRacket cannot process programs until you choose a programming language. Either select the “Choose Language…” item in the “Language” menu, or get guidance. > I've tried to type racket -f as.scm, but it doesn't work. I've type the same instruction in my MacBook Terminal, it doesn't work either. I don't know what to do next. Have I got the wrong racket? Thanks, jsgrahamus, for your reply :)
17.
2 points by old-lie 2001 days ago | link | parent | on: [META] Finding My Old Posts

Having located the old account's link, it looks like I must point-and-click my way along, gently up the stream.

http://www.arclanguage.org/user?id=Adlai

18.

I was a bit shocked when I saw this and wondered how they’d handled tail call optimization since there’s no nice way to do a computed jump in web assembly. It turns out it relies on the new tailcall extension to web assembly that isn’t enabled yet in most browsers.

Still this is pretty cool! A lot of languages have web assembly compilers but few seem to make self hosting a priority.

19.
2 points by tug 2475 days ago | link | parent | on: HTTP Request in ARC

this seems to be part of it

https://github.com/arclanguage/anarki/blob/b700e02f1442b6f56...

20.
2 points by whitten 2652 days ago | link | parent | on: Show Arc: Serializable Closures

Could you elaborate on this or give me pointer what we re it is discussed?
21.
2 points by ARG 2656 days ago | link | parent | on: Is Arc being used for anything in production?

IIRC, Laarc (https://www.laarc.io) (Hacker News Clone) is running Arc (don't quote me on that though).
22.

It's in the same place. Try adding some text outside the table tag. For example:

  (mac npage (title . body)
    `(tag html
       (tag head
         (gen-css-url)
         (prn "<link rel=\"shortcut icon\" href=\"" favicon-url* "\">")
         (prn "<meta name=\"viewport\" content=\"width=device-width\">")
         (prn "<base target=\"_blank\">")
         (tag script (pr votejs*))
         (tag title (pr ,title)))
       (tag body
         (center
           (tag (table border 0 cellpadding 0 cellspacing 0 width "85%"
                       bgcolor sand)
             ,@body)
           (prn "Copyright blah blah")))))
23.
3 points by sht 2667 days ago | link | parent | on: Variables & scoping complaint

He wants it to be a little more like scheme wherein:

   (define (f)
     (define v 10)
     ...)
creates v as a local variable. In Arc, and most lisps, you need to do:

   (defun f ()
     (let ((v 10)) 
       ...))
Additionally, Arc has the wrinkle (i think, i haven't used Arc recently) where if you do:

   (defun f ()
     (= v 10)
     ...)
you create a global variable and assign 10 to it, instead of the python default which creates v in local scope. Basically, he's trying to use imperative programming and doesn't want to declare local variables using let.
24.
3 points by nupa 2682 days ago | link | parent | on: Running in DrRacket?

Thanks! And yes I'm on windows, although that command didn't work at first -- protip, you can't run it from a powershell prompt, it has to be a cmd prompt. Weird.
25.

update: having it self evaluate (or evaluate to a hashtable with quoted keys and non-quoted values maybe) instead of a syntax error seems like a better choice
26.

I see what you mean, making it self evaluate seems like the best option.
27.

I think you should have to quote them. Like how you have to quote lists:

    '(foo bar)
is just a list, but

    (foo bar)
will either call the function foo or error if it doesn't exist.

So in a similar way

    {foo "bar"}
should give a syntax error, but maybe it can have some kind of semantic meaning later. I've been considering that square brackets could be used for assignment/local binding, to cut down on the need for LET (not necessarily in arc just in lisp in general).
28.

It would be nice if it the way it prints out is the same as the way it is written

  arc> (= user '{name "John Doe" age 23 id 73881})
  {(age . 23) (id . 73881) (name . "John Doe")}
or

  arc> (= user '#{name "John Doe" age 23 id 73881})
  #{(age . 23) (id . 73881) (name . "John Doe")}
where

  arc> #{foo "bar"}
gives a syntax error. extra brackets like [] and {} may be used in macros as special syntax.
29.
2 points by adas 2727 days ago | link | parent | on: Clojure Anaphoric Macros

Didn't consider a double `%then` or `%else`, thanks. Raises some interesting problems.

Generally the plan is to have a special character control whether it gets bound or inlined, probably `!`. So say `%test!` would get inlined like right now, while using `%test` would bind (and doing both would also be possible). But for a `%then` you'd generally only want to bind if there's 2+ so I could count usages instead.

30.
3 points by adas 2727 days ago | link | parent | on: Clojure Anaphoric Macros

Author here. Glad to see some interest, sometimes I lurk here and now I feel bad not having submitted here myself.

Interestingly the "%else" would actually be cataphoric, as you refer to what comes next rather than before. So "co-referential macros" would be more fitting if you want to stick with the linguistics analogy. But that'd be too exotic of a term.

And yes as akkartik notes, it causes multiple evaluations right now, mostly just laziness and indecision on my part. I'll probably be giving control over this. Here's a real example of code where you actually want current behavior:

  (aif (ns-resolve *ns* 'specs)
    (let [c (compile spec :name name)]
      (swap! (var-get %test) update (:property c) set/union #{c}))
    (do (intern *ns* 'specs (atom {}))
         %then))
Would love to hear if anyone has some crazy ideas. Beyond just conditionals too.
More