freenode/lisp - IRC Chatlog
Search
14:00:23
jcowan
In some domains there is no hope for "programmers". The original programmers were people who took code written in assembler by "analysts" and traanslated it into ones and zeros. Nobody does that any more, fortunately.
14:01:24
jackdaniel
and yet quality of that software banged with rocks was much more meticulus than many things written today
14:01:27
jcowan
Closer to our own time, who would write an LALR(1) parser nowadays without a yacc equivalent? Much better to write rules and semantic fragments.
14:01:57
jcowan
jackdaniel: It had to be, since "programmers" were cheeap and machine time was unbelievably expensive.
14:02:48
jcowan
The more skilled programmers become and the cheaper computers become, the more the emphasis shifts. Airplane embedded programming is still done very carefully.
14:13:06
splittist
ACTION predicts that by the time trivial-treeshaker is developed and adopted the average lisp implementation will fit in a single neoTCP packet
14:23:57
attila_lendvai
splittist, there's hu.dwim.perec ; it works pretty well with the postgresql backend
15:59:27
Josh_2
kinda hard to describe but right now I have had to write (ps:lisp (format stream "var ~A;" <my var>)) to get it to initialize the variable
16:16:31
Josh_2
https://plaster.tymoon.eu/view/2393#2393 here this is the code I'm basically trying to serialize a CL object into some javascript, store that under a variable name in a top level script which can be referenced in another part of my webpage
16:17:14
Josh_2
but I'm having to add that (ps:lisp (format ..)) in order to get var <variable-name>; to appear in the outputted JS, I'm trying to avoid that hackery
21:08:50
Josh_2
For each stib in stibs I'd expect output like https://plaster.tymoon.eu/view/2395#2395
21:30:01
jasom
ignore the last 2 lines, they don't work because the binding isn't available at macroexpand time. Either use ps* or the raw format you currently use
21:56:51
kagevf
what's the difference between ps:ps and ps:ps* ? I didn't really understand the difference reading the tutorial ...
22:11:15
jasom
ps:ps processes the parenscript at macroexpand time, so must take literal parenscript forms
22:21:20
jasom
Josh_2: derp, do this instead of the format expression: (ps:lisp `(defvar ,unique-id))
22:52:54
kagevf
right ... I think your solutions are better and more concise ... but if I didn't have those I think symbol-to-js-string is what I would try to use in my ignorance
22:53:47
kagevf
so is it better to think of it has an actual string in JS as opposed to the sting that's output by ps?
22:59:20
jasom
ps transforms s-expressions into strings. A string (which is what symbol-to-js-string) in the s-expression will always output a string in javascript.
23:03:18
kagevf
"SYMBOL-TO-JS-STRING is the Parenscript function responsible for translating Common Lisp symbols to JavaScript identifiers" <-- that part in the reference is a little confusing, in light of what's been demonstrated here today
23:03:24
jasom
e.g. if your json library makes a hash-table you can (gethash (ps:symbol-to-js-string 'foo-bar) ...) to use the same identifiers in your PS as when you get from JSON
23:04:14
kagevf
a-ha! that example you just gave reconciles that part in the reference with the actual usage
23:04:15
jasom
Right below that is the intended use: "It is helpful for writing libraries or other pieces of code that will interface with Parenscript-generated JavaScript."
23:04:47
jasom
so if you run ps on the frontend and get js on the backend, your backend will use symbol-to-js-string
23:07:30
kagevf
using parenscript on the backend? on the backend I would just use regular CL and something like cl-json, right? the hashtable example you wrote makes a lot of sense though ...
23:11:19
kagevf
ok ... I think by "backend" you mean generating the parenscript that will handle the json on the server/backend, for use on the frontend ... did I understand that right?