Arc Forumnew | comments | leaders | submit | svetlyak40wt's commentslogin

Malisper, I like your approach. Even thought to do something similar myself. Thank you!

-----

2 points by malisper 3753 days ago | link

Thank you. I would say the things to note would be defalias, ssyntax (in experimental), and how I used packages to redefine the standard procedures.

-----

2 points by svetlyak40wt 3826 days ago | link | parent | on: Awesome Python

Hey guys (and probably girls, if there are some :))!

I think, we need something like this but for Arc. Awesome Arc page with categorized libraries.

-----

2 points by S4M 3822 days ago | link

Actually, is Arc used anywhere except for this forum and HN?

-----

2 points by akkartik 3822 days ago | link

We hear about the odd person using it when they come here to ask questions or report bugs (e.g. http://arclanguage.org/item?id=18580). Often we can't tell what they're up to, but the most common impetus seems to be to build a HN-like community for their own interests, such as http://arclanguage.org/item?id=18620, or http://arclanguage.org/item?id=17325.

Googling around, I found it quite easy to find a HN clone called http://firespotting.com at https://github.com/mmccaff/PlacesToPostYourStartup. Another location: http://www.quora.com/Hacker-News/Whats-the-best-way-to-creat.... There's other stacks now to create clones, but many clones still use arc.

The biggest install I know of is http://hubski.com. Perhaps we should keep a list somewhere. But really what we seem to care about here is thinking about alternative stacks. That and helping beginners to programming in general or arc in particular :)

-----

1 point by akkartik 3825 days ago | link

You should build it! It'll be a lot shorter :)

-----


Yes, I mean exactly something like this :)

-----

2 points by akkartik 3833 days ago | link

Great. We still needed some way to pass args to arc, so my changes aren't totally useless.

-----

1 point by svetlyak40wt 3915 days ago | link | parent | on: A FizzBuzz solution in Arc

That is not fair in this case. Please, write example code in terms of Arc3.1 primitives.

-----

2 points by heated 3910 days ago | link

Ok

-----


Wow, I forgot about another my founding:

  * https://github.com/mgiken/arc-mg - improved Arc3.1 version with libraries and bindings even to libcurl (1 year)

-----

1 point by akkartik 3950 days ago | link

Ooh, I'd never seen this one before!

-----

3 points by svetlyak40wt 3950 days ago | link

By the way, I discovered it with my tool, which I'm writing in Arc to learn this language. This tool crawls GitHub starting from Anarki repository, to find other interesting projects, written in Arc.

-----

2 points by akkartik 3949 days ago | link

Found it: https://github.com/svetlyak40wt/arc-crawler. Awesome.

-----

2 points by rocketnia 3949 days ago | link

Does this tool find Arcueid? :) That project's on GitHub too.

https://github.com/dido/arcueid

-----

3 points by svetlyak40wt 3945 days ago | link

Tried arcueid. It is unstable. For example, running this simple code:

  (thread (while t (prn "Still going")))
Ends very quickly with error like this:

  arcueid: cont.c:54: __arc_mkcont: Assertion `(((struct vmthread_t *)(((struct cell *)(thr))->_obj))->spr) > (((struct vmthread_t *)(((struct cell *)(thr))->_obj))->stkbase)' failed.
  zsh: abort      ~/tmp/arcueid-base/bin/arcueid

-----

2 points by svetlyak40wt 3945 days ago | link

I've changed the test to count iterations:

  (thread (let i 0 (while t (prn "Still going: " i) (++ i))))
and it every time broke on 7270 iteration.

-----

2 points by svetlyak40wt 3945 days ago | link

Recursive code like this:

  (def my-loop ((o i 0)) (prn "Still going: " i) (my-loop (++ i)))
  (my-loop)
Performs much better. It fails only after 21799 iteration:

  Still going: 21799
  arcueid: env.c:83: __arc_mkenv: Assertion `(((struct vmthread_t *)(((struct cell *)(thr))->_obj))->spr) > (((struct vmthread_t *)(((struct cell *)(thr))->_obj))->stkbase)' failed.
  Still going: zsh: abort      ~/tmp/arcueid-base/bin/arcueid
:(

-----

1 point by akkartik 3945 days ago | link

I think all the errors you're seeing are due to running out of heap. How much memory do you have? Is there some per-process limit, perhaps to RLIMIT_AS?

Edit 35 minutes later. I can reproduce that it dies for me at the precise same iteration as you. And RLIMIT_AS is infinity, so that's not the issue. I've pinged the author for comment.

-----

2 points by svetlyak40wt 3944 days ago | link

Thank you. But now I think it would be wise not to complain about the issue on the forum, but rather to create an issue on the project's github. Will do it now.

Update: done — https://github.com/dido/arcueid/issues/60

-----

2 points by dido 3942 days ago | link

Well, thanks for the bug report. Well, I'll look into it when I have the time: the work which pays my bills has caught up with me once again and I don't have a lot of time to do hobby development. :)

-----

2 points by svetlyak40wt 3945 days ago | link

Well, actually, even without threading, arcueid running code:

  (let i 0 (while t (prn "Still going: " i) (++ i)))

Fails with exception:

  arcueid: cont.c:58: __arc_mkcont: Assertion `(((struct vmthread_t *)(((struct cell *)(thr))->_obj))->spr) > (((struct vmthread_t *)(((struct cell *)(thr))->_obj))->stkbase)' failed.
after 7266 iterations.

-----

2 points by dido 3942 days ago | link

The assertion error is a stack overflow. :) At present Arcueid makes use of a fixed-size stack within its virtual machine, and since the compiler still can't properly optimise tail recursion, your code overflows the stack.

-----

1 point by akkartik 3941 days ago | link

That was what I thought :) Is there a place where I can increase the size of the fixed stack? I looked for the limit in the code, but couldn't find it.

-----

3 points by dido 3941 days ago | link

src/vmengine.h:236:

#define TSTKSIZE 65536

Increase it as high as you like. :)

-----

1 point by akkartik 3940 days ago | link

Thanks!

Does it make sense to resize it on the fly when we discover we've overflowed the stack? Or are there potentially continuation pointers into the stack that would be non-trivial to track down?

-----

1 point by akkartik 3940 days ago | link

Yeah, no luck: https://github.com/akkartik/arcueid/commit/ae31b82540

-----

1 point by akkartik 3931 days ago | link

Possibly relevant: http://wingolog.org/archives/2014/03/17/stack-overflow

-----

3 points by svetlyak40wt 3949 days ago | link

Well, I haven't tried to run crawler with large depth setting yet. I discovered, that it have strange problems with threading and almost unable to process in parallel. Then I tried to investigate why. Will make a separate post on it, when will get some valuable information.

-----


So, why nobody wants to discuss this topic?

-----

2 points by akkartik 3950 days ago | link

I don't know how to answer it :) There's a lot of code in the world. I can help answer questions on some of it, but I have no idea what's most promising.

I upvoted you because I was happy to see the list, and I'd be interested in other people's answers.

-----

2 points by svetlyak40wt 3950 days ago | link

Well, probably I should ask another question, addressed to the different implementations' authors: "Why do you started to write your own implementation instead of making efforts to improve Anarki?" :)

-----

1 point by akkartik 3950 days ago | link

There was a thread about this recently that was a lot of fun: http://arclanguage.org/item?id=17597

-----

1 point by svetlyak40wt 3950 days ago | link

By the way, is there an IRC channel or some other place for more informal talks?

-----


Wow, this is very helpful even without source locations!

-----

2 points by akkartik 3957 days ago | link

Indeed, this is wonderful. I've updated anarki.

-----


Why there isn't any module system yet?

-----

4 points by rocketnia 3964 days ago | link

Historically speaking, Arc was put forward as a language for experimentation. If you want to package up code in a squeaky clean format for others to use who don't care about implementation details, you're doing something other than experimentation; you're publishing a product people would supposedly rely on.

Moreover. not even the Arc language is stable (or so this website has always said). If it encouraged people to package up their stable code, that would prove deceptive once the whole foundation fell away. This happened to Anarki when Arc 3 was released; the community had built up lots of Arc 2 code, and not much of that was ported to work on Arc 3.

However, Arc is not without module systems. The first thing I did in Arc was build some namespace macros with explicit imports and exports for my own benefit (Lathe). Andrew Wilcox made "the hackinator" which I think could download Arc programs from a Web-hosted manifest file, most often from GitHub.

More recently, Arc/Nu is an Arc implementation with rich support for first-class namespaces, along with several utilities for modular loading of Arc code that's written in the usual sequence-of-commands style. Arc/Nu is probably the best platform to publish stable modules for, since it can load alternate namespaces to achieve backwards compatibility.

-----

2 points by svetlyak40wt 3963 days ago | link

Thank you for detailed answer, now reasons are more clear to me!

-----