Arc Forumnew | comments | leaders | submitlogin

Thank you, that's exactly what I was looking for.

For Vim: http://arclanguage.org/item?id=10147

Then you can use :TOhtml: http://vimdoc.sourceforge.net/htmldoc/syntax.html#:TOhtml

2 points by jhowe 4799 days ago | link | parent | on: Syntax highlighting mode for .arc files

Here, I found the arc.el for you: https://github.com/arclanguage/anarki/blob/master/extras/arc...
2 points by rocketnia 4800 days ago | link | parent | on: Using Arc with jQuery?

Here's another Arc-inspired language which runs in the browser:

https://github.com/Pauan/nulan (project page)

http://pauan.github.io/nulan/doc/tutorial.html (interactive tutorial in the browser)

Arguably, it improves upon Arc in many, many ways. :) Perhaps Arc's main advantage is that there are more people who use and maintain Arc. I'm sorry to say I've never used Nulan for anything, even though I'm suggesting it here.

2 points by rocketnia 4800 days ago | link | parent | on: Using Arc with jQuery?

When ClosureScript came out, it didn't support eval (and it still doesn't, I think!), so I was motivated to build an eval-capable version of Arc in the browser. Behold Rainbow.js:

https://github.com/arclanguage/rainbow-js (project page)

http://arclanguage.github.io/rainbow-js/test/ (interactive REPL)

It's a direct port of Rainbow (https://github.com/conanite/rainbow), but with a hand-rolled parser and a hand-rolled implementation of asynchronous stream I/O. Like Rainbow, it "compiles" Arc code to an intermediate representation and interprets that. Rainbow was already a fast Arc implementation (faster than official Arc!) so Rainbow.js is pretty speedy as well. I used to think it was even faster than Rainbow itself, but then I realized that was due to a bug. :-p

I haven't been motivated to use Rainbow.js myself, because it has many quirks: Some quirks of its own (e.g. no threads), some inherited from Rainbow (e.g. no bignums, and weird call/cc behavior during macroexpansion), and of course all the quirky features of Arc (e.g. ssyntax). It also has some quirks which are truly necessary to make it usable; for instance, its (load ...) implementation loads from the Web, because there is no filesystem. While this (load ...) fix makes some sense, it's not always clear to me what the best behavior would be. Instead of pondering these small design questions and imposing my own decisions on this project, I've been working on other language designs from the ground up instead.

By all means, see if you can get Rainbow.js to work. I don't have ideas to improve this project myself, but you're not the only one who's wanted to use something like this, so your ideas could could help those other people. :)

1 point by zck 4800 days ago | link | parent | on: Using Arc with jQuery?

You'd have to write a compiler from Arc to Javascript. As far as I know, there isn't one.

Alternately, it might be easier to write a compiler from Arc to ClojureScript, and then use the existing ClojureScript compiler.


Can you try it with http://github.com/arclanguage/anarki if you aren't already? Your ascript.js example works with it for me.

To make the .lsp example work you have to modify static-filetype at lib/srv.arc (https://github.com/arclanguage/anarki/blob/31b773d91a/lib/sr...) to handle the new extension. I'm away from my usual machine, so can you send me a pull request if you get it working? :)


I should add a link to the community-managed version: http://github.com/arclanguage/anarki#readme

For a perpetual newbie in Lisp/Scheme/etc, they have been very helpful to me.

PG has said he's still working on it, but you probably shouldn't rely on seeing further updates from him.

The community here makes updates from time to time, and I think we're pretty responsive to questions and bug reports. But our changes are not 'blessed' by PG or anything. Since PG has said that "future releases can break anything", such a blessing wouldn't be of much use anyway.

Bottomline: It's not for you if you just want features and don't care how they're built. But if you like the idea of gradually mastering the internals of the tools you rely on -- welcome aboard! You don't have to know anything at the start; we try to be very helpful.

(New version of http://arclanguage.org/item?id=17869)

3 points by rocketnia 4806 days ago | link | parent | on: When I type 'mzscheme -m -f as.scm'

Here's a comment I made in an earlier thread (http://www.arclanguage.org/item?id=14747):

The -m option means to call the "main" function now. Just leave it out. It used to mean "--mute-banner", which suppressed the "Welcome to MzScheme" line.

1 point by akkartik 4806 days ago | link | parent | on: When I type 'mzscheme -m -f as.scm'

Yeah, I think the '-m' flag was deleted sometime after v372.
2 points by zck 4806 days ago | link | parent | on: When I type 'mzscheme -m -f as.scm'

If you're using Arc 3.1 with a recent version of Racket (I can verify it works with Racket 5.3.1, but it should work with anything newer than that also), you just call it via `racket -f as.scm`. Arc 3.1 can be found here: http://ycombinator.com/arc/arc3.1.tar . Check out the unofficial Arc wiki for more information: https://sites.google.com/site/arclanguagewiki/

thank you

  $ mzscheme
  Welcome to Racket v5.2.1.
  > (load "as.scm")
  Use (quit) to quit, (tl) to return here after an interrupt.
  arc> ^Cuser break
  > (acompile "arc.arc")
  [...output elided...]
  > (exit)
  $ head arc.arc.scm
  (begin
    (let ((zz
           (ar-funcall2
            _annotate
            'mac
            (let ((| do| (lambda args `((fn () ,@(ar-nil-terminate args))))))
              | do|))))
      (namespace-set-variable-value! '_do zz)
      zz))

No, I'm going to set that up. Ok, thanks!

I don't think we've received this question before, but try starting them on separate ports and use apache or nginx rewrite rules to map say <site>/blog to the new port. Do you already use apache or nginx to hide the port in the url?
3 points by fallintothis 4819 days ago | link | parent | on: Discussion about macros in Arc

Sure thing! I was a teacher in a previous life, so I enjoy helping people learn...to say nothing of whether I'm any good at it. :)
3 points by zck 4820 days ago | link | parent | on: Discussion about macros in Arc

Yeesh, I can feel my mind expanding. It's fighting it, but it's going.

Thanks again for the tutoring. I can't help but think this would be an order of magnitude easier in person, but c'est la vie.

3 points by fallintothis 4821 days ago | link | parent | on: Discussion about macros in Arc

I.e., "party on zck's bitbucket!" :)

I think the discussion might be interesting to other folks here. And at least bitbucket has inline code formatting!

1 point by akkartik 4822 days ago | link | parent | on: Create a "sticky" post in news.arc

Great. Definitely ask us more questions as they come up. I wasn't sure how much you already knew but we can dig into details as you need them.

Also, you might find this site useful for documentation about join and other arc vocabulary: http://arclanguage.github.io/ref/fnindex.html

2 points by thisisdallas 4822 days ago | link | parent | on: Create a "sticky" post in news.arc

Ok, great, thanks for reply! I'm still really new to arc so, to be honest, it doesn't really make sense without looking at the actual. Hopefully, later today/this week, I will have some time to sit down and really look into things. Once I get something functioning I will definitely send a pull request.
2 points by akkartik 4822 days ago | link | parent | on: Create a "sticky" post in news.arc

The list of stories on the frontpage is generated by the function topstories. That's where you'll want to join a sticky post, either hardcoded or saved in a separate file like the arc/news/topstories file.

Disabling comments seems a little more involved. You'll need to add an attribute (say allowcomments) to the item deftem, and then check for it in:

a) displaying the commentlink in display-story, and

b) comments-active, which is checked before displaying the comment-form

Let me know if this makes sense. If you get it working, send a pull request to https://github.com/arclanguage/anarki!

2 points by zck 4822 days ago | link | parent | on: Re-announcing my unit test library for arc

Thanks for the feedback, both here and on the bug in the bitbucket tracker.

I'm not sure of my feelings on changing all the asserts to be just one. On one hand, it is simpler to have just the one command. On the other, it seems like a much more complicated interface, as you would never guess how to use it from, for example, the method signature. assert-t, assert-same et. al. seem like a lower conceptual load.

It reminds me of the arguments over CL's loop macro -- who knows all of it? I can never remember how to do much of what I want. Of course, this is much simpler than loop. Maybe I'll implement it and see how it feels.


Note that assert-same requires the expected value before the test-value. This is needed for pretty, pretty messages when the assert fails:

Maybe I'm just tired, but I first took this to mean that it was impossible for assert-same to be defined so that its arguments were (actual expected (o fail-message)). Now I realize that you just mean the positions of your expected/actual values are important.

One design thought: the name assert isn't taken by Arc. You could simplify the interface while generalizing it by just separating assert from the things it's asserting.

So, the basic assert would essentially be assert-t, and the other three could follow. Something like

  (assert-t actual (o fail-message))
  ; becomes
  (assert actual (o fail-message))
  ; or, without the custom message
  (assert actual)

  (assert-nil actual (o fail-message)) 
  ; becomes
  (assert (no actual) (o fail-message))
  ; or, without the custom message
  (assert:no actual)

  (assert-error actual (o expected-error))
  ; becomes
  (assert (error actual (o expected-error)) (o fail-message))
  ; or, without the custom message
  (assert:error actual (o expected-error))

  (assert-same expected actual (o fail-message))
  ; becomes
  (assert (same expected actual) (o fail-message))
  ; or, without the custom message
  (assert:same expected actual)
Then, you define error and same to "do the right things". same would probably need to throw an error when the arguments were mismatched, so that you could generate the nice message---assuming that assert would catch errors and report them as failures. error would be easy to define. Maybe something like

  (mac assert (condition (o fail-message))
    `(on-err (fn (c) ...fail...)
             (fn () (unless ,condition ...fail...))))

  (mac same (expected actual)
    (w/uniq (e a)
      `(with (,e ,expected ,a ,actual)
         (or (iso-that-works-on-hash-tables ,e ,a)
             (err "" ',actual 'returned ,a 'wanted ,e))))) ; modulo prettiness

  (mac error (expr (o expected-error))
    `(on-err (fn (c) ...pass, modulo expected-error...)
             (fn () ,expr ...fail if we get here without an error...)))
Solid work, though!
1 point by zck 4823 days ago | link | parent | on: Re-announcing my unit test library for arc

Well, one other one is brianru's oauth library (http://arclanguage.org/item?id=17925), but I don't think it's publicly released yet. Not to be too stalkeresque, but it's not on his Github (https://github.com/brianru?tab=repositories).

Lisp In Summer Projects hasn't made a list available that I know of. Certainly they will announce the winners; I don't know if they'll announce all the projects. Hopefully.


Wow. Is there a way to see the other 4 projects?
2 points by zck 4823 days ago | link | parent | on: Re-announcing my unit test library for arc

Also notable about Lisp In Summer Projects is that 2% of the first 250 entries are in Arc: http://lispinsummerprojects.org/Stats
2 points by zck 4823 days ago | link | parent | on: Re-announcing my unit test library for arc

I've mentioned my unit test library before (http://arclanguage.org/item?id=17922), but now I think it's pretty much ready for prime time. It reports results nicely (if verbosely), and you can run decent subsets of your tests. It even has a README!

One thing that fell out of this is that there's no built-in way that I know of to check hashes for equality in Arc. Even `iso` doesn't do it (https://bitbucket.org/zck/unit-test.arc/issue/18/make-assert...). So I wrote a way (https://bitbucket.org/zck/unit-test.arc/commits/a007eb6491c3...).

The only big thing that I really want to do for usability right now is to not have a ton of lines of "test X passed!" (https://bitbucket.org/zck/unit-test.arc/issue/20/optionally-...).

I'd love to hear feedback, whether on this forum or by submitting a bug (https://bitbucket.org/zck/unit-test.arc/issues/new). This is a weird thing, but as I'm doing this project for Lisp In Summer Projects (http://lispinsummerprojects.org/), I'm supposed to do pretty much all the work myself. I'd love to take patches after the contest closes.


Thank you!
More