a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by yotta
yotta  ·  3709 days ago  ·  link  ·    ·  parent  ·  post: Reimplementing Markdown in Arc Lisp

Hey, forwardslash, do you have any recommended resources for learning arc? I have pretty good experience with typed functional languages (haskell, OCaml) but not very much with lisp (if that makes a difference). Do you like it?





forwardslash  ·  3706 days ago  ·  link  ·  

The only resources I use are the arclanguage forum, arc tutorial, and the source of projects like Anarki. All that I have learned about arc has been primarily from working with hubski's codebase. If there's some area that I'm not familiar with I'll try and follow the data path of a request that involves that area. For instance, the first thing I did when I joined the team was added magnet links. I started with figuring out how arc dealt with requests which lead me to how you define urls in arc (with the newsop function). Eventually I burrowed down into app.arc and found the functions which validate urls in order to make them clickable. Months of doing this is how I got to where I am now.

As to whether I like it, I can say that I wouldn't choose it as a language for a project. That said, I still have enjoyed working with it. It was my first functional language (I later learned Haskell last semester) and got me out of thinking purely in the C/Java world I had lived in all throughout school. All in all it's a very simple language with unique features, but most of my complaints aren't necessarily with the language but with the code written with arc that we use.

For example, we don't have nice urls like you'd expected from other sites with things like example.com/user/forwardslash; instead we have to use query strings. This stems from how we defined our routes such as user pages which starts with

  (newsop user (id)
    ...)
This defines hubski.com/user and binds the value of id in a query string to the variable id. User here is not a string but a literal identifier, so we can't define any sort of dynamic route. There is probably a solution to this but it would involve rewriting some if not most of our server code. Again, not necessary a complaint with the language but with the srv.arc implementation.

Other things I have grown to not be fond of despite being interesting concepts are dirty and anaphoric macros. Basically I just miss namespacing and I think anaphoric macros are bugged at the moment (they like to eat local variables).

wildptr  ·  3662 days ago  ·  link  ·  

Small question about Arc, coming from a Haskell background. I've used Yesod for web applications, and it has a database-agnostic API for persistence (called yesod-persistent). Is there a similar tool for Arc, or is there at least a database API to any specific one?

forwardslash  ·  3661 days ago  ·  link  ·  

I wish more than anything else that arc had any sort of database API, but as it stands our database is just flat files loaded into memory in a hashtable. Racket and scheme (which arc is built on) have some database APIs but you'd have to cross define them in arc which isn't trivial.

wildptr  ·  3661 days ago  ·  link  ·  

Thanks for the reply! But that's disheartening, along with the whole fnid problem.

wildptr  ·  3661 days ago  ·  link  ·  
This comment has been deleted.