Arc Forumnew | comments | leaders | submit | lojic's commentslogin
4 points by lojic 6614 days ago | link | parent | on: A wiki, in Arc: Arkani now on Anarki

I think your name choice of 'Arkani' may be confusing wrt 'Anarki'

-----

6 points by almkglor 6613 days ago | link

Yes. It's even in a file named wiki-arc, to make it even more confused with arc-wiki

-----

3 points by treef 6614 days ago | link

but it is fun

-----

6 points by lojic 6616 days ago | link | parent | on: So, hey, I finally deployed my Arc blog

Well done, the site does look good. I'm not a fan of tables either, but I do try and get my html to validate. You have a few errors on the page - you might want to check out the following:

  http://validator.w3.org/
About done with high school, eh? Boy, I feel old now :)

-----

2 points by wfarr 6616 days ago | link

Yeah, a lot of the validation issues come from Arc's somewhat stubborn nature regarding tags that should end with a slash.

For now, I've moved the doctype to HTML 4.01 Transitional and all is well. I really would like to go back to XHTML though.

The CSS could use some work too, but most of the issues with that are my early adoption of some css3 standards.

-----

3 points by lojic 6616 days ago | link

Given that the browser with 80% to 90% can't handle XHTML properly, and after long drawn out debates in usenet over the best doctype, I've personally settled on HTML 4.01 Strict. Once I discovered how IE actually handles XHTML, that sealed the deal.

-----

2 points by wfarr 6616 days ago | link

As an update, after much heartbreak over not knowing about (cdata), the RSS now validates as well.

-----

4 points by lojic 6616 days ago | link | parent | on: Are you using Arc for a web site?

Thanks for the reminder about screen, that seems like a good approach.

So to be able to access the repl, did you start asv in a separate thread?

-----

3 points by brett 6616 days ago | link

yeah. http://arclanguage.org/item?id=1272

-----

4 points by lojic 6616 days ago | link

Thanks - I had forgotten about the repl operator that pg mentioned in that thread. I'll have to try that out.

I love the quote from Ron Garret about the benefits of a REPL.

  "Debugging a program running on a $100M piece of hardware
  that is 100 million miles away is an interesting experience. Having a
  read-eval-print loop running on the spacecraft proved invaluable in
  finding and fixing the problem."

-----

3 points by lojic 6617 days ago | link | parent | on: Are you using Arc for a web site?

You're probably right about not waiting. I probably won't have time until after this weekend anyway, so we'll see if we get an Arc3 gift :)

Good to hear about MzS 360, that's the package that installed on my local Ubuntu 7.10 system.

I just installed it on an older Ubuntu server that I'll be using for production and got 352, so that should be pretty safe given that's what pg is using.

-----

2 points by lojic 6618 days ago | link | parent | on: Predicates: `is...' versus `...?'

Are you referring to is, isa, iso, isnt, etc. ? If so, what would you propose for those instead?

-----

7 points by lojic 6620 days ago | link | parent | on: Map et al arguments are backwards

What you're suggesting is closer to the way Ruby does it with the function being last:

  [1, 2, 3].map {|x| x * x }   # OR

  [1, 2, 3].map do |x|
    # larger function
  end
However, I think (map f list) is preferred since you're applying the function to the list. It's also the way Haskell does it, so it must be right :)

-----

4 points by tel 6620 days ago | link

Haskell chooses this order because partial application and pointfree style are really common.

   let squareall = map (^2)
   squareall [1,2,3] ===> [1,4,9]
   squareall [3,4,5] ===> [9,16,25]
   let f = foldr1 (+) . squareall . filter even
   f [1,2,3,4,5] ===> 20
But since partial application is not a default behavior in Arc ([map square] and [map _ square] are not that different from one another) the order of the fn and list aren't as important.

Rule of thumb might be: put the fastest changing piece last, but this syntax thing might be a stronger heuristic.

-----

5 points by lojic 6623 days ago | link | parent | on: Will Arc ever be as fast as CL?

Welcome to the Arc forum.

It's premature to say what type of performance Arc will eventually provide, but I'm not aware of anything in the language that would preclude good performance - it will depend on the implementation of the production compiler.

Is there a particular aspect of Arc that causes you concern with respect to performance? Also, do you have a particular application in mind, or is you concern a hypothetical one?

-----

2 points by pgwoden 6621 days ago | link

Thanks. It's not the language itself that I'm concerned about. Rather, I'm wondering how much interest there will ever be in developing a truly fast Arc.

Consider Python, for example. It's been around for a while and is widely used. Yet it's still pretty slow. Fast enough for building websites, sure, but it's nothing like C or Fortran for serious numerical work.

Python's supporters will tell you that its slowness doesn't matter, because you can re-write the time-consuming bits of your code in C. I can imagine that that works well for web programming where latency accounts for much of the execution time anyway and one might only occasionally have a really chunky calculation to do. But in my experience doing Monte Carlo simulations, solving large systems of non-linear equations and that type of thing, a large part of the code is fairly critical for execution speed, so re-writing in C would mean doing a large part of the project in C. If I wanted to do that, I'd just write in C to begin with.

-----

1 point by lojic 6621 days ago | link

What programming language do you currently use for your numerical work?

-----

1 point by pgwoden 6620 days ago | link

I've experimented with Ruby and Python lately, with the hard-care numerics to be written in C, as I alluded to above. I've not actually done huge amounts of programming recently, although in the past I did so in a proprietary language resembling C and in Fortran. Recently I have a look at CL (which accounts for my interest in Arc) and at OCaml, though I've not yet used either extensively.

-----

1 point by lojic 6623 days ago | link | parent | on: Regular expressions

Here's the file list with line counts to give you an idea of the scope w/o having to download the tarball.

  $ find . -name \*.lisp | xargs wc
  1264   5548  62182 ./api.lisp
   579   2692  27510 ./closures.lisp
   811   3294  40252 ./convert.lisp
    84    425   3686 ./errors.lisp
   736   3030  32096 ./lexer.lisp
    56    288   2362 ./lispworks-defsystem.lisp
    67    324   3100 ./load.lisp
   579   2219  25300 ./optimize.lisp
   106    333   3736 ./packages.lisp
   323   1397  15593 ./parser.lisp
   268   1070  13784 ./ppcre-tests.lisp
   807   2950  31225 ./regex-class.lisp
   844   4049  42124 ./repetition-closures.lisp
   507   2515  26187 ./scanner.lisp
   147    660   5347 ./specials.lisp
   299   1547  12843 ./util.lisp
  7477  32341 347327 total

-----

2 points by treef 6623 days ago | link

It also looks like its OO using Clos and it looks very un-arcish presenting the very hard problem with in CS - naming things - or in this case renaming things shorter.

-----

1 point by lojic 6624 days ago | link | parent | on: Can't paste Arc code out of emacs

I think I found the problem. It looks like the auto-coding-alist is the culprit:

  (("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|exe\\|rar\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|EXE\\|RAR\\)\\'" . no-conversion)
   ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion)
   ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion)
   ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
   ("\\.pdf\\'" . no-conversion)
   ("/#[^/]+#\\'" . emacs-mule))
Documentation:

Alist of filename patterns vs corresponding coding systems. Each element looks like (REGEXP . CODING-SYSTEM). A file whose name matches REGEXP is decoded by CODING-SYSTEM on reading.

The settings in this alist take priority over `coding:' tags in the file (see the function `set-auto-coding') and the contents of `file-coding-system-alist'.

-----

3 points by nex3 6624 days ago | link

Okay, here's a new solution:

  (dolist (coding auto-coding-alist)
    (when (and (string-match "[Aa][Rr][Cc]\\\\|" (car coding))
               (eq (cdr coding) 'no-conversion))
      (setcar coding (replace-match "" nil nil (car coding)))))
I'll replace the fix in arc.el.

-----

1 point by lojic 6624 days ago | link

Cool. And thanks for the great elisp examples - I'm just learning elisp (and Lisp in general), so every bit helps.

-----

1 point by nex3 6624 days ago | link

No problem :-).

In my experience, the most important thing to remember when learning elisp is "C-h f", followed by "C-h i m elisp RET".

-----

1 point by nex3 6624 days ago | link

Are you sure this is it? Because my solution (http://arclanguage.org/item?id=4536) works for me, and doesn't touch auto-coding-alist.

Edit: Oh, wait, maybe it's not working. Gah.

-----

1 point by lojic 6624 days ago | link

Yes, I'm sure :) I did:

  C-h v auto-code-alist
and clicked on the customize link, then removed arc, and everything works great.

If only pg used emacs :)

-----

1 point by lojic 6624 days ago | link | parent | on: Can't paste Arc code out of emacs

No, I'm simply selecting text with the mouse in an Arc buffer and trying to paste with the middle-button in a non-emacs window such as this text area.

I've narrowed the problem down to the filename extension. Here's the test:

  brian@airstream:~/temp$ cat > temp.arc
  hello, world
  <ctrl>-d
  emacs temp.arc
Then select some text with the mouse and try and paste in a non-emacs window using the middle button. I can do this with everything but files ending in .arc !

  brian@airstream:~/temp$ emacs --version
  GNU Emacs 23.0.60.2
I just killed my .emacs file as a test and I get the same results, so you should be able to duplicate that if you're on Linux.

With no .emacs file, I see the following message when loading temp.arc:

File mode specification error: (error "Buffer format not recognized")

I expect that's related. Maybe we can get pg to use another extension like .arclisp :)

-----

2 points by nex3 6624 days ago | link

Okay, now I'm seeing the problem. I'll poke around with it.

Edit:

Looks like you're right: .arc is recognized as an archive-mode file. This snippet should fix it:

  (let* ((mode (rassoc 'archive-mode auto-mode-alist))
         (str (car mode)))
    (string-match "[Aa][Rr][Cc]\\\\|" str)
    (setcar mode (replace-match "" nil nil str)))
I've added this to arc.el.

-----

1 point by lojic 6624 days ago | link

So it's not sufficient to add the new arc.el, you have to remove the existing association also? I would think that once a match is found in the auto-mode-alist, it wouldn't consider the other entries.

BTW I started a thread on gnu.emacs.help, but if the above fixes it, it's moot.

http://groups.google.com/group/gnu.emacs.help/browse_frm/thr...

-----

1 point by nex3 6624 days ago | link

Well, I added the above code to arc.el, so it should automatically disassociate *.arc with archive-mode.

-----

1 point by nex3 6624 days ago | link

Okay, this didn't actually solve it. This should, though: http://arclanguage.org/item?id=4548.

-----

1 point by lojic 6624 days ago | link

Yay, I'm not crazy! :)

-----

More