Arc Forumnew | comments | leaders | submit | thaddeus's commentslogin
2 points by thaddeus 5750 days ago | link | parent | on: Arc + Emacs + Windows - Cygwin?

http://ftp.gnu.org/pub/gnu/emacs/windows/

-----

1 point by icarus 5748 days ago | link

I already have emacs installed on my windows machine, but I don't know how to configure .emacs file and obtain something similar to SLIME for CL: working repl buffer and commands for executing code from other buffers in REPL.

Does anybody know how to configure emacs to work nicely with arc, on windows?

-----

2 points by thaddeus 5748 days ago | link

I am not sure if this does it for you, but the following link appears to account for scheme + lisp + windows.

http://paste.lisp.org/display/50797

I dont use emacs, but I found it pretty easy to find good sites on this kind of stuff.

http://www.google.com/search?hl=en&q=.emacs+and+slime-se...

-----


Anyone notice that titling on postings are being modified by the program or something else?

Seriously - Originally I had thought it was just me, but I am noticing this more now.

Even google cache proves it's been changed:

http://www.google.com/custom?domains=arclanguage.org&q=M...

used to be:

'Why is arc built on mzscheme vs other scheme implementations'

-----

1 point by fallintothis 5751 days ago | link

I imagine it's the same as http://news.ycombinator.com: editors (e.g., pg, though I'd guess there are others) can change titles, usually to correct grammar. Not as much headline-editorializing can happen in a forum such as this (versus news.yc), so titles probably get edited less here.

-----

1 point by thaddeus 5751 days ago | link

I think that's an incredibly bad idea, particularly when 'they' are not improving the data.

-----

1 point by fallintothis 5751 days ago | link

Welcome to the news.yc discussion circa about 2 years ago ;)

http://news.ycombinator.com/item?id=43635

In the case of this title, the only way it got "worse" is that someone goofed on a space, "onMzScheme". An editor could now step in, add a space, and the only difference would be that proper nouns were capitalized. Not that the edit was wholly necessary, but it's not like the title was censored.

-----

1 point by thaddeus 5751 days ago | link

It's really kinda funny. When I post, I notice the submit function capitalizes the first letter of the first word of the title's sentence.... sometimes I look at that and say to myself - hey! that's not what I typed!. So I go back in and edit the title changing the first letter back to lower case as intended (correct or not). The update function allows this to pass through. So now that I see (more than once) my text being changed I find myself feeling like I have to battle the bots (or the nots!). It just feels wrong.

-----

1 point by aw 5751 days ago | link

That's good to know about being able to edit the first letter back to lowercase -- on occasion I've started a title with a function or macro name that should be uncapitalized.

-----


Maybe just put:

  (load "news.arc")
  (nsv)
at the bottom of your as.scm file (since this file loads successfully).

-----

2 points by thaddeus 5751 days ago | link | parent | on: How do I run mzscheme non-interactively?

> I would like to run hacker news in batch mode ?

Why would you want to do that? If it's just so the terminal window isn't up, I would suggest using screen -> http://www.gnu.org/software/screen, or if using a mac you could run an apple script which would run the process silently:

     do shell script "cd /Users/thaddeus/arc;
     /Users/thaddeus/scheme422/bin/mzscheme -f loadscript.scm"
> how to run it alongside apache, or listening on a particular ip address?,

I think this is more an apache discussion point so I would suggest google searching 'mod proxy'. There's are tonnes of write ups on this kind of stuff and Linode.com has in-depth how to's. Mod Proxy just redirects incoming requests from an IP/domain to a specific port. As for Arc see the function (asv) which you can change the port number and just run it - I think it's in srv.arc.

-----

1 point by user2 5751 days ago | link

Let me describe a bit more:

Here's what I normally do as per how-to-run-news.txt

mzscheme -f as.scm

I get the mzscheme prompt. I type:

(load "news.arc") (nsv)

It runs well, so far so good, but I have the interactive interpreter. As soon as I shut down, the service disappears.

To run it as a shell script I looked at mzcheme man page and tried to run the following in a script called run_hacker_news.sh:

[script starts] #! /bin/sh #|

exec /home/bahadir/mz/bin/mzscheme -f as.scm |# (load "news.arc") (nsv) [script ends]

This doesn't work. I just want to run it and logout so it stays running. It's a linux box. Thanks a lot.

-----

1 point by thaddeus 5751 days ago | link

> It runs well, so far so good, but I have the interactive interpreter. As soon as I shut down, the service disappears.

This is where 'screen' comes in handy. Screen is a threaded model: it assigns a single thread for each 'screen' used. It also has a built in command to detach from your screen session (CNTRL+a d). After detaching you can then close the terminal window and arc will still be running as a silent thread. To get back just launch screen with the option to re-attach ($ screen -x).

-----

1 point by user2 5751 days ago | link

The parts with parenthesis () are multi-line, the post is displayed as single line somehow.

-----

1 point by thaddeus 5751 days ago | link

You need an extra line break to separate lines.

  Or indent a line by at least two spaces to get text verbatim.

-----


Ah yes. Thank you. It's always good to hear from the horses mouth....

-----


hmmm... too bad. I have yet to try gambit, but I like the idea that it's fast, supports 64 bit systems and along with termite http://code.google.com/p/termite/ there's concurrency model similar to Erlang. Though I am not sure that would even work with arc, but at a faster version of arc with a concurrency model sounds better to me.

I'm just in this investigating/researching languages + features mode lately :)

-----

1 point by thaddeus 5753 days ago | link | parent | on: Ask ArcLang: What do you write Arc in?

> What environment do you program in?

I use Textmate with Terminal. There's an bundle for it here -> http://github.com/aran/arc.tmbundle It's a little out of date, but you can easily hack changes to it if you need to.

> What does Arc have built in? Is it ALL covered in the tutorial?

Arc has nothing built in (for ide/gui/editor management), so it's not covered in the tutorial.

> Why isn't there a little website that lists and documents all the built-ins in Arc?

I think pg (paul graham) has chosen this forum as a means for distribution/collaboration. I suggest you check into -> http://af.searchyc.com/ since, by default, the forum has no built in search mechanism There's also google -> http://lmgtfy.com/?q=arc+forum+between (lol - I had to use lmgtfy at least once in my life :).

Also.... I know conanite has built an arc interface -> http://arclanguage.org/item?id=6002, but I haven't tried it.

-----


It would be nice to see the performance benchmarks on Factor too.

http://shootout.alioth.debian.org/u64/which-languages-are-fa...

-----

1 point by fallintothis 5756 days ago | link

Incidentally, they do implement the benchmark game's programs (and then some): http://gitweb.factorcode.org/gitweb.cgi?p=factor/.git;a=tree...

They just don't want to submit them yet -- work being done on the compiler and such: http://www.reddit.com/r/programming/comments/2krih/factor_90... (granted, this link is a year old)

For some hand-spun results, you can check out http://factor-language.blogspot.com/search?q=shootout or http://factor-language.blogspot.com/search?q=benchmark. I think the most recent results for Factor's benchmark suite are at http://factor-language.blogspot.com/2009/08/global-float-unb....

-----

1 point by fallintothis 5756 days ago | link

For the sake of pedantry, the month-old http://www.reddit.com/r/programming/comments/9ukis/improved_... confirms the year-old reddit post. I would've edited my post, but alas, ran out of time. I'll stop flooding with links now.

-----

1 point by rocketnia 5756 days ago | link

Yeah. I was hoping at least Forth would be on there, but no luck, I guess.

-----


I only spent about 5 min looking at factor. There are many appealing features, but I went as far as seeing "Hello World" and moved on.

Hello World in Arc:

   arc> (pr "Hello World")
   Hello World
Hello World in Haskell:

   Prelude> putStrLn "Hello World"
   Hello World
Hello World in Factor:

   USE: io
   IN: hello-world
   hello ( -- ) "Hello world" print ;
   MAIN: hello
The code syntax is just not pleasant on the eye.

-----

1 point by fallintothis 5756 days ago | link

Actually, you've presented Factor's hello world as though it were a file. They have a REPL, too -- they call it the listener, though. You can either use the GUI version it comes with or from the command line do

  $ factor -run=listener
  Loading ~/.factor-rc
  ( scratchpad ) "Hello word" print
  Hello word
The syntax is aesthetically pleasing in an important way: it's very consistent. While postfix might not look "right" at first, it belies an incredibly simple parsing algorithm -- one that allows for easy definitions of the words like USE: and IN: and even :.

Not that you need to learn Factor. Just sayin'.

-----

1 point by thaddeus 5756 days ago | link

Actually it's not I that present it this way:

http://concatenative.org/wiki/view/Factor/Examples

I presumed that without "USE: io" that "Hello World" was not being sent to the standard output where as my arc/haskell examples actually were. i.e. With arc I could load/run a file/script with (pr "Hello World") and it would output "Hello World", but with Factor?...

I just went to each language site and looked for the Hello World examples. It may be that Factor could do a better job advertising AND that I need to spend more than 5 minutes looking :)

Another language to add to my list to learn....

-----

2 points by fallintothis 5756 days ago | link

Yikes, editing race-conditions. I'll fork this off into a different reply.

I presumed that without "USE: io" that "Hello World" was not being sent to the standard output

Actually, that line's like an import statement in Haskell. I would say it's like load in Arc, but that's not really true; USE: and import have to do with module systems, which Arc doesn't have. If you're already familiar with modules, you can skip this stupid explanation, but...

Basically, modules let you structure your functions into different places so that they don't mess with each other. As a silly example, maybe you write a text adventure in Arc and name a function get, as in (get 'ye-flask). But Arc already defines a function called get, as in (map (get 'a) list-of-hash-tables). You want to be able to use both of them at the same time, but would rather not rename your new function. If Arc had modules, you could qualify the function name with the name of the module in which it's defined. Something like

  (use 'game)
  (game.get 'ye-flask)
  (map (get 'a) list-of-hash-tables)
But when you don't want to use Arc's get, you could still overwrite it with the text adventure's get and not need to prefix it with the module name.

This is a vast oversimplification, of course, but that's essentially what they do. So, in languages like Factor, all the I/O routines are in a module called "io". In the io library is a function called print. If you don't need to print things, you don't need to USE: io, which helps keep the "surface area" of your code small.

i.e. With arc I could load/run a file/script with (pr "Hello World") and it would output "Hello World", but with Factor?...

Because Arc doesn't separate anything into modules, you don't need to import things like pr since it's already there by default. The reason the Haskell code in my other reply could do without the import is that putStrLn is similarly defined in Haskell by default: it's in the so-called "standard prelude". That's what the Prelude> prompt tells you in GHCi. You can import other libraries in GHCi, and the prompt will tell you what you're using:

  Prelude> :m + Control.Monad
  Prelude Control.Monad> :m + System.IO
  Prelude Control.Monad System.IO> :m + Foreign.C.Types
  Prelude Control.Monad System.IO Foreign.C.Types>
Hope that helps.

-----

1 point by thaddeus 5756 days ago | link

> Yikes, editing race-conditions. I'll fork this off into a different reply.

yup... I should really write then post :)

> Hope that helps.

It really does. Thanks for taking the time to reply.

-----

1 point by fallintothis 5756 days ago | link

It may be that Factor could do a better job advertising

True. After all, transliterating the Factor example to Haskell looks something like

  module Main where
  import System.IO (putStrLn)

  hello :: IO ()
  hello = putStrLn "Hello world"

  main = hello
Of course, in Haskell you would just write

  module Main where

  main = putStrLn "Hello world"
My point here is that the Factor code doesn't do any real magic. When you give it a chance, the syntax is quite powerful.

It's really neither here nor there: picking a language and getting at least somewhat comfortable with it is going to be better than endlessly deliberating. They all have their merits (even bad languages!).

I'm babbling. Move along. :)

-----


Too bad the poll feature for this forum doesn't allow for everyone to submit 'choices'. :(

-----

More