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

Wifi is spotty here, but here's all the stuff I have in my config for a past project:

    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Referer $http_referer;
Does that work? If so, can you post the minimal headers needed? Thanks.

-----

1 point by lark 4812 days ago | link

It doesn't work for me.

(pr req!ip) keeps showing the IP address of the server rather than the IP address of the client.

I need a way of telling clients apart. Perhaps I should be looking at cookies instead.

-----

1 point by akkartik 4812 days ago | link

To plumb the X-Forwarded-For IP to req!ip, try the patch at http://www.arclanguage.org/item?id=11199. (See gotcha #3 at https://sites.google.com/site/arclanguagewiki/arc-3_1/known-...)

-----

2 points by lark 4809 days ago | link

Thanks. It seems this should work with Anarki.

-----


BTW, I've been interested in how we implement closure-based webservers for some time now (http://arclanguage.org/item?id=17265), so it was interesting to read citations [43,66,80] just above Question 1. In particular, Christian Queinnec also assumes such state can't be persisted (and so eliminates the option of multiple servers): http://www.cs.grinnell.edu/~rebelsky/courses/CS302/2007S/Rea...

-----


FWIW, I'd submitted it a long time ago: http://www.arclanguage.org/item?id=16698 :) Totally worth looking into.

-----

3 points by akkartik 4818 days ago | link | parent | on: Generalizing iflet

1. I like your final solution! But no reason why either of ours couldn't be done in vanilla arc.

2. (whenlet var expr ...) could also be written:

  (let var expr
    (when var ...))
So I don't think letwhen is strictly necessary.

3. Another alternative formulation is:

  (let var expr :when (f var)
    ...)
All that's really saving us is a couple of parens compared to the original pattern. Maybe we don't need a macro, just a different indentation convention:

  (let var expr (when (f var)
    ...))
But both these make the conditional nature of the block harder to see. My original solution and yours don't have that drawback.

-----


Are you on linux on the server? There's a program called GNU screen which lets you run interactive processes and reconnect to them later: https://www.gnu.org/software/screen

You can probably install it with apt-get or yum or something.

-----


Care to do a mini-review? :)

-----

1 point by akkartik 4825 days ago | link | parent | on: Syntax and nesting: Lispy or Algol'ish?

We should discuss the reference to Honu in particular: https://www.cs.utah.edu/plt/publications/gpce12-rf.pdf

-----

1 point by akkartik 4826 days ago | link | parent | on: Syntax and nesting: Lispy or Algol'ish?

I posted a response there, exploring what such a lisp would look like: http://lambda-the-ultimate.org/node/4692#comment-74446

-----

1 point by akkartik 4827 days ago | link | parent | on: Syntax and nesting: Lispy or Algol'ish?

:)

Regarding your comment at http://lambda-the-ultimate.org/node/4692#comment-74440: I'd never seen https://sites.google.com/site/arclanguagewiki/more/list-of-l... before! I should update wart's infix status..

But I don't follow the 'affects semantics?' column.

-----

2 points by rocketnia 4826 days ago | link

akkartik: "I've never seen [that page] before!"

Whoops, I guess I never posted it here. XD I made it right after we had a thread about yet another one of these languages, and then I chatted about it with Pauan and never returned to it.

Maybe I was waiting until I could document what I meant with the columns. Google Pages disappoints me, because although it'll support a sortable table like this, there's no option to add an explanatory caption. I was thinking of posting an explanation in a comment, but that's not a community-editable part of the wiki, right?

Guess I'll describe my intentions right here. Feel free to migrate these explanations to a better home, and of course, feel free to redesign the table to make it better.

---

Language: The name of the language.

Whitespace: In what way does whitespace matter to the parsing of a program text?

Infix arithmetic: Some users care about expressing their arithmetic-heavy code using traditional infix notation. Does the language syntax tailor itself for this purpose by special-casing particular arithmetic operators? If so, the answer is "Hardcoded." Otherwise, does it provide generic mechanisms so this user can be satisfied? If it doesn't, the answer is "No." If it doesn't provide hardcoded mechanisms but does provide generic ones, what are they?

Affects semantics?: To make it onto this list, the language must have a syntax that transforms into a uniform yet non-semantic nested structure like s-expressions. It must also have some sugar that's explained as an abbreviation of particular kinds of structure. By the time the programmer has a structured representation of the code to work with, are there still visible remnants of these abbreviations? If so, how so?

---

Maybe the infix arithmetic column would be better off as two: A "generic infix" column and a "domain-specific notation" column. Just because a language provides good generic mechanisms doesn't mean it can't hardcode some traditional notations too.

Maybe if the "Affects semantics?" answer is "No", we should add another shade of meaning to indicate that the project actually has no semantics to affect. I think Readable Lisp S-expressions pretty much falls into this category, and so does "Gel: A Generic Extensible Language."

On the other hand, Gel actually saves a lot of detail about the user's input (e.g. which parentheses they used), and any language that uses Gel would probably have to normalize away the unwanted detail in a second stage, possibly in a way that the programmer can notice.

To digress further... Racket allows macros to discover which parentheses were used, but then it treats all parentheses the same after macroexpansion. Do alternate parentheses count as an s-expression abbreviation? If so, I think Racket should make this list, and it should be listed as having an abbreviation layer that affects semantics. (Consider that Racket also has an infix "abbreviation": (a . -> . b) means (-> a b). Not to mention that (a b c) abbreviates (a . (b . (c . ()))) in a wide variety of lisps.)

-----

2 points by akkartik 4826 days ago | link

I added a link to your comment. Clunky, but better than nothing.

-----

1 point by rocketnia 4826 days ago | link

Oh! That's just the place I wanted to add a caption. XD

Was it as easy as pressing the pencil icon in the corner?

-----

2 points by akkartik 4826 days ago | link

Yeah :) Super weird having two ways to edit stuff. Apparently there's no revision control for changes to the table contents itself.

-----

2 points by Pauan 4827 days ago | link

"But I don't follow the 'affects semantics?' column."

I think it means whether the parsing happens before macros are run or not. In Arc, ssyntax happens after macros, so macros can affect the meaning/behavior of ssyntax. In most Lisps, syntax is read before macros, so macros can't change the meaning.

---

Ah yes, Nulan has changed since that page was added, I'll go in and update it...

-----


I was reminded of my notation for cyclical lists: http://arclanguage.org/item?id=17362

-----

More