Arc Forumnew | comments | leaders | submit | krapp's commentslogin
3 points by krapp 217 days ago | link | parent | on: What other dialects should I check out?

Racket would be the obvious choice, and maybe Clojure.

-----

3 points by krapp 241 days ago | link | parent | on: Nested comment system

Nested comment systems tend to use one of two patterns - both of which assume you're using a relational database. Arc forums doesn't, which IMO greatly reduces flexibility in exchange for Lisp purity.

The most common pattern is the "adjacency list" model[0]. Every entry has an ID and parent ID, at least. You can also include an "origin" ID for the root of the tree. For this, you need to build an entire thread with recursive queries (for each ID, get children of ID, etc.) HN and other Arc based forum use this.

Slightly more involved is the "nested set" model[1] which actually maintains a balanced tree. It's easier to query an entire tree than with the adjacency list, but insertions and deletions are more costly.

[0] https://en.wikipedia.org/wiki/Adjacency_list

[1] https://en.wikipedia.org/wiki/Nested_set_model

-----


https://github.com/arclanguage/anarki

-----

2 points by mdwalters 486 days ago | link

Thanks! I'll check this out later.

-----

2 points by krapp 510 days ago | link | parent | on: Why Bel after Arc

From what I can tell from the introduction[0] and initial HN thread[1] Bel is an academic exercise in developing a programming language by focusing on axioms rather than implementation. Also:

    I think the point of a high-level language is to make your programs shorter. All other things (e.g. libraries) being equal, language A is better than language B if programs are shorter in A. (As measured by the size of the parse tree, obviously, not lines or characters.) The goal of Bel is to be a good language. This can be measured in the length of programs written in it.
Make of that what you will.

[0]https://sep.turbifycdn.com/ty/cdn/paulgraham/bellanguage.txt...;

[1]https://news.ycombinator.com/item?id=21231208

-----


There is a database wrapper (database.arc) in /lib that should support postgres.

It isn't well documented and only tested on a SQL connection but it's just a set of wrappers around Racket's DB drivers, so you could try including that into your app.

Unfortunately I seem to have completely lost my test project but the connection should work as follows:

    (= dbconn (postgresql-connect user db password))
Hope that helps.

-----

1 point by markkat 1032 days ago | link

Thanks! So far no avail, but I'll try some more!

btw I caught a misspelled 'password' in postgresql-secure-connect:

  (mac postgresql-secure-connect (user db ssl-protocol (o passowrd nil))

-----

1 point by krapp 1031 days ago | link

>btw I caught a misspelled 'password' in postgresql-secure-connect:

oops. It's fixed, thanks.

-----

1 point by markkat 1031 days ago | link

btw, would this be the correct syntax for table-exists?

  (= dbconn (postgresql-connect "root" "root" password))
  (table-exists? dbconn "items")

-----

1 point by krapp 1030 days ago | link

yes.

-----


>should be nil but instead was nil

I'm sorry, what?

-----

1 point by zck 1301 days ago | link

It's printing out the two values it's comparing. Not sure yet why they're not the same.

It makes more sense when you see an error message like "should be 3 but instead was 2".

-----

1 point by krapp 1321 days ago | link | parent | on: Trouble running Anarki on Windows 10 Home

If you're on Windows, try starting it with arc.cmd.

Then to run Anarki (app-start "news") at the prompt.

-----

2 points by jsgrahamus 1320 days ago | link

I downloaded a new version, and it started just fine. Thanks.

-----


The Anarki fork should work, I run it in Windows.

https://github.com/arclanguage/anarki

-----


Possibly related: https://github.com/arclanguage/anarki/issues/70

If so the solution: http://www.arclanguage.org/item?id=11199

-----

2 points by akkartik 1386 days ago | link

I don't think so, since OP mentioned Arc 3.2 without any Nginx. I just tried it and I'm able to reproduce this issue with just the official branch in anarki (which is identical to Arc 3.2) without any Nginx.

Arc 3.2 doesn't get very frequent updates, but we should probably fix this in the stable branch. It shows the same error, and also has some errors in the log. Unfortunately I'm not sure when I can get to this. I've been having some RSI issues and time at the computer is limited at the moment.

-----


>I think it's also not super onerous to require people to manually update the docs when making changes.

It really isn't. I need to add documentation for a lot of things.

-----

2 points by krapp 1453 days ago | link

This is a bit off topic but what happened to the projects tab for the repo? I had a vaguely organized project for the forum up there.

-----

2 points by akkartik 1452 days ago | link

Oh sorry, I cleaned up some tabs because I saw tabs overflowing into a menu on the right. I'll restore it.

-----

3 points by krapp 1452 days ago | link

Ok thanks.

Also, hey everybody, there's a project tab for the forum on the repo. Feel free to add to it, or whatever.

I'll get around to working on it again sooner or later.

-----

More