Arc Forumnew | comments | leaders | submit | jmatt's commentslogin
3 points by jmatt 6199 days ago | link | parent | on: New Anarki MySQL FFI interface

This is great!

I've got a project that is using sqlite. I'll port it over to mysql and test it this weekend.

-----

5 points by jmatt 6200 days ago | link | parent | on: Response to the Arc Challenge

As an arc developer, I create compliant or not compliant HTML. It's the developer's choice, not the framework's job. That is nice that their are some frameworks out there that always create strictly compliant HTML but it's not necessary for a great web framework. I think a lot of innovations will continue to come from non-compliant hacked web code.

-----


I think that's a good idea.

-----


http://codegolf.com/choose

  (def f (n) (if (> n 0) (* n (f (- n 1))) 1))(def c (n k) (/ (f n) (f k) (f (- n k))))(def m (i) (let v (map [coerce (trim _ 'both) 'int] (tokens i #\,)) (c (car v) (cadr v))))
or

  (def f (n) 
    (if (> n 0) 
      (* n (f (- n 1))) 1))
  (def c (n k)
    (/ (f n) (f k) (f (- n k))))
  (def m (i) 
    (let v
      (map [coerce (trim _ 'both) 'int] (tokens i #\,)) 
      (c (car v) (cadr v))))
(m "5, 3")

(m "22, 9")

(m "100, 3")

(m "75, 71")

(m "30, 1")

(m "1, 1")

(m "4, 0")

v 1.0 of code golf choose challenge. 175 bytes passes test cases minimal work to simplify or shorten it.

-----


The problems include excellent descriptions and test cases.

Plus as a bonus you can code golf and try for the shortest solution. I haven't code golfed anything in arc, but I bet it'll do well.

-----

1 point by lojic 6207 days ago | link

Hmm... I'd expect a language with lots of syntax and a large built-in library to do well.

-----

1 point by jmatt 6207 days ago | link

That is true for some of the problems but not all of them. For instance the choose challenge.

I also think it's part of PG's design goals to have a concise powerful language. (http://www.paulgraham.com/arcchallenge.html)

Even though code golf is program length instead of counting codetree nodes, it's a similar idea and provides interesting small problems to learn on.

-----

5 points by jmatt 6209 days ago | link | parent | on: Poll: Priorities

My experience shows one real application could easily require many, many libs. Yes there are exceptions, don't bother listing them because the rest of the universal code base relies on libraries.

Libraries are both a weakness and strength for lisps. Yes there are libs that do EVERYTHING out there. Each one has a different style and approach. There are no standard methodologies across the libraries. This makes it difficult. Everytime a developer brings in another library they have to figure out how to use it. Versus interfacing with libraries in python, ruby or even Java / C#... everything is much more uniform.

There is a bigger opportunity with small to medium size experimental projects. I think a great example is: http://www.pageonetimes.com/ which is based on PG's news code.

personal-finance-management system

In the past I've implemented front and back-end financial software. I think it's a huge undertaking and best implemented with as many tested and true libraries as you can find. It's absolutely possible in arc, but why use arc when it's not the best choice (for now atleast). Meanwhile there are a number of other areas where the code will not be nearly as library dependent.

a dedicated arc IDE

I think an IDE is a great idea. In my opinion, the way to do it is to use existing IDEs. DrScheme (already works...), Eclipse, SLIME all come to mind. Now before everyone goes nutty thinking we need our own IDE - yeah eventually. But who is going to put in hundreds of hours of time into implementing a new IDE when you could plug into three existing IDEs in a fraction of the time.

I think at this point a completely new IDE would need to incrementally improve on the best IDEs that are out there. VIM, Emacs, Eclipse, XCode, VisualStudio, etc (ya, a decent IDE seems to be one of the few things M$ does right).

-----

4 points by antiismist 6209 days ago | link

I agree that the lack of libs is a real problem. My real world example: I have have a bunch of RSS feeds, and I want to regularly poll those feeds, extract some content, and add it to my site (pageonetimes.com).

Doing it with Arc alone is too much for me - for mysterious reasons get-http.arc isn't working for me. Even if it did, I would have to write my own rss parser. Instead I am using Ruby for this, and grabbing the RSS content, parsing it, and saving the results is about 10 lines of code using standard libraries.

-----

4 points by stefano 6209 days ago | link

What kind of problems exactly does get-http.arc give you? It's a translation of a piece of Common Lisp code I had written to be able to fetch RSS feeds. The CL version worked well for the task.

-----

1 point by antiismist 6208 days ago | link

Here is what happens:

  arc> (get-request (str->url "http://yahoo.com/"))
  Error: "procedure ...narki/arc/ac.scm:1231:11: expects 2 arguments, given 3: 
  #hash((\"CONTENT-TYPE\" . \"text/... \"LOCATION\" #hash((\"CONTENT-TYPE\" . \"text/..."

(I think the problem lies with me, in that I don't know how to use the library...)

-----

3 points by stefano 6208 days ago | link

I've tried your example and gives me (obviously) the same error, but trying

  (get-request (str->url "http://www.yahoo.com/"))
works. I will investigate further.

BTW, get-request returns a list containing the header of the response and a string containing the page (when it doesn't raise and error, of course).

Edit: bug solved. New version on github!

-----

1 point by antiismist 6207 days ago | link

Thanks you are awesome. So what do you use for RSS parsing?

-----

2 points by stefano 6207 days ago | link

In my CL project I thought to parse it manually, but I've abandoned the project after finishing the HTTP part. I've never tried using it, but you could have a look at treeparse in Anarki, if you haven't done already.

-----

4 points by jmatt 6210 days ago | link | parent | on: Poll: Priorities

personal-finance-management

http://www.mint.com/

-----


I think this would be a fun and useful project for the community and any newcomers. There is already a scheme dialect in the top 5 languages, Guile.

I don't know the best way to begin. Maybe add it to Anarki with a link to the perl code for now. I think it's a huge undertaking and could progress pretty slowly if PG doesn't actively develop arc. But at the same rate it could be really useful to find arc's weaknesses.

-----


Maybe this should be a top-level question?

Yeah!

-----


Yeah, there is a reason PG chose PLT Scheme. To begin with, coming back to arc will not be difficult. PLT Scheme has a lot of libraries and code samples. And it's mature and portable. The dialect is still actively being used and developed. All good reasons to use it.

Personally I've finished my website in arc, I just need to do one more move to the production web server. I'm going to leave it in arc and update it as the language is updated by PG / Community.

I think anyone looking for another language should consider common lisp and smalltalk. I've been coding in both recently and it's been a pleasure after I familiarized myself (again).

http://arclanguage.org/item?id=2995

http://arclanguage.org/item?id=6319

-----

More