IRC channel logs

2015-09-20.log

back to list of logs

<ArneBab_>paroneayea: what do you mean with flush?
<goglosh>um, I can't find the format directive for lisp-readable output
<goglosh>you know, so that if I feed it #\\A it'll print it just like htat
<goglosh>that*
<mark_weaver>goglosh: ~s
<goglosh>thanks!
<mark_weaver>yw!
<ahmedtd>Does anyone know of a pre-existing guile library to manipulate extended file attributes?
<amz3>ahmedtd: what is extended file attributes?
<amz3>I stumbled upon pi-calculus or pattern calculs, this sound awesome! https://en.wikipedia.org/wiki/Pattern_calculus
<amz3>I'm wondering how far from is it from guile and guile-log pattern matching
<amz3>ACTION diving opencog
<ahmedtd>Posix extended file attributes -- they allow you to attach arbitrary metadata to a file
<amz3>I don't know that thing, but guile is POSIX compliant so probably it support it
<amz3>ACTION looks manual
<ahmedtd>The functions don't seem to be in base guile
<amz3>can you give me a reference in another language ?
<ahmedtd>They would probably named setxattr/getxattr if they were
<ahmedtd>man setxattr
<ahmedtd>Those are the system calls
<ahmedtd>man 5 attr describes the general extended attribute subsystem
<amz3>ACTION looking https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index
<amz3>well I did find nothing
<amz3>you can use ffi
<amz3>it's straightforward to implement there is only 3 function :)
<amz3>ahmedtd: what's the purpose of those metadata attribute in general?
<ahmedtd>Some are used for acls/security
<ahmedtd>But they can be used for arbitrary purposes
<ahmedtd>They aren't very portable, though, so in practice not much uses them
<amz3>I find maybe a good use, say I download something with wget. wget could add the origin url as metadata of the file
<ahmedtd>(I was mistaken, they don't seem to be posix)
<amz3>this sound like useful
<mark_weaver>ahmedtd: I'm reluctant to add support for Linux-specific syscalls to core Guile, but on the plus side, with modern Guile it's trivial to write FFI wrappers in pure scheme for such a simple API.
<mark_weaver>see section 6.20 (Foreign Function Interface) in the guile manual
<mark_weaver>especially 'pointer->procedure'
<paroneayea>ArneBab: like this
<paroneayea>wisp@(guile-user)> if #t
<paroneayea>... display "horray\\n"
<paroneayea>what I really want is
<paroneayea>
<paroneayea>wisp@(guile-user)> if #t
<paroneayea>.................. display "horray\\n"
<amz3>how intersting is pattern calculus and rho-calculus?
<amz3>I mean is it pratical?
<taylanub>ugh, guile segfaulting. an exception would have been nicer. maybe I can ,trace
***uu is now known as __uu__
<sbp>ArneBab: been reading your py2guile essay. why does the only define-syntax-rule example not use Wisp/SRFI-119?
***nalaginrut_ is now known as nalaginrut
<taylanub>aha, using 'module-ref' is what makes Guile segfault, somehow. I can reproduce it, but not make sense of it. I'm not using threads in my code...
<taylanub>oh, Guile's "random" is actually deterministic O_o that's why the segfault always happens the third time I run a certain procedure of mine. that's pretty neat actually; now I know the exact input that causes it and how to reliably reproduce that input.
<paroneayea>taylanub: you need to seed it
***karswell` is now known as karswell
<paroneayea>(set! *random-state* (random-state-from-platform))
<taylanub>I figure. for now it actually helps me with reproducability though :)
<davexunit>once again wondering how to handle particle simulations with thousands of particles without causing tons of GC
<davexunit>in a functional style, of course.
<amz3>ACTION reading opencog wiki
<amz3>IIRC it's a (hyper) graph which basically means documents with links between the document
<amz3>I mean the above is atomspace but it's central
<amz3>the links have different weight values
<amz3>a top of that, it's possible to model pattern matching over the graph using atomspace
<amz3>using graph pattern matching, one can implement algorithms
<amz3>I was under the impressoin that atomspace was turing complete somehow but there is not mention of it
<amz3>but durig the graph traversing you can execute scheme callbacks
<amz3>here is example (pattern matchin) queries: http://wiki.opencog.org/wikihome/index.php?title=Neo4j_Backing_Store#Example_OpenCog_biology_query
<amz3>my plan is to... use wiredtiger \\o/
<paroneayea>hello!
<amz3>héllo :)
<paroneayea>davexunit: guard them until the level ends and just accrue thousands of particles, obviously ;)
<paroneayea>s/thousands/millions/
<davexunit>paroneayea: :)
<davexunit>I can easily remove a good deal of GC pressure by making sure that rendering doesn't allocate much.
<paroneayea>ugh I don't want to do my contracting work
<paroneayea>I just want to hack on my projects!
<paroneayea>so it goes.
<paroneayea>I should just be grateful to have contracting work until the end of the month I guess ;p
<davexunit>I frequently feel the same, s/contracting/full-time/
<paroneayea>hey civodul, btw I know you're super busy, but if you get a chance to make comment on my https stuff on list, that would be awesome
<paroneayea>though!
<paroneayea>it's not urgent because there are some things for me to fix in it probably also, but if you have suggestions, would be most welcome :)
<civodul>paroneayea: ok, will look into it, prolly tomorrow
<paroneayea>civodul: \\o/
<ArneBab>paroneayea: so you would like the REPL to indent automatically?
<ArneBab>sbp: do you mean the in=m part?
<sbp>ArneBab: yep!
<ArneBab>sbp: that’s because I needed a better roundtrip between the code and #guile ☺ (make it easier to check with other schemers whether the code is correct)
<ArneBab>(because I stumbled a lot during implementing that, and showing mark weaver wisp makes it needlessly hard for him to check the code
<ArneBab>I could change that, though…)
<sbp>not everybody here already knows Wisp/SRFI-119 fluently?
<sbp>very interesting article, anyway. thanks for writing it!
<paroneayea>ArneBab: I'm not sure if indent automatically
<ArneBab>sbp: definitely not :)
<paroneayea>ArneBab: I think it would be extra great if the first number of characters could "not matter"
<paroneayea>hence why I put more ... than 3
<ArneBab>the first spaces don’t matter, just that they are more than the previous line
<paroneayea>ArneBab: sure
<paroneayea>I suppose that's true
<paroneayea>so automatic indentation would also solve it
<ArneBab>sbp: wisp is pretty experimental, though it can harness all of Guile
<ArneBab>sbp: but that’s because the compiler tower in Guile is pretty well-designed
<paroneayea>ArneBab: I think that wisp is "the right direction" when it comes to non-sexp type representations of otherwise sexp'y languages
<ArneBab>sbp: well, as experimental as something can be whose syntax won’t change
<paroneayea>ArneBab: you did a good job! :)
<ArneBab>paroneayea: I’m happy to hear that ☺
<ArneBab>one of the reasons why I started with it was that I thought about the question in which kind of language I would want to teach programming…
<ArneBab>sbp: I just updated the article to match what I have on disk.
<sbp>ArneBab: a friend of mine, Eric S. Tiedemann, once created a lisp called e7 which was meant to mimic Python as closely as possible. you can think of it as an ancient version of Hy, except it was implemented in C. a year or two ago I tried to repeat the experiment in a series of macros on top of Common Lisp (using SBCL). your py2guile article makes me wonder whether I couldn't do the same thing in Wisp now
<ArneBab>sbp: feel free to try — and please tell me how it works out!
<paroneayea>sbp: maybe also take inspiration from Dylan?
<paroneayea>another cool language somewhere between lisp and python/ruby...
<sbp>I've heard that Dylan was a very good language, but I haven't used it myself
<sbp>I should probably check that out, thanks for the nudge
<paroneayea>I wanted to package Dylan in Guile but Dylan is now written in Dylan
<paroneayea>er
<paroneayea>in Guix
<paroneayea>and I didn't feel like doing bootstrapping stuff
<paroneayea>heh, good quote on slashdot
<paroneayea>"The number of UNIX installations has grown to 10, with more expected. -- The Unix Programmer's Manual, 2nd Edition, June 1972"
<taylanub>hahaha, I wonder if they expected to go from 10 to millions
<paroneayea>easy to forget just how few installations of *any* operating systems there were at that ime
<ArneBab>sbp: note that I did not try to get as close as possible to Python, but rather to find a representation which is as simple as plain scheme sexps and *feels* like Python.
<ArneBab>sbp: I think that wisp is the simplest indentation-based syntax (aside from fixed-width indentation) which can represent arbitrary code structures.
<paroneayea>I think wisp's main feature as a representation is that it's homiconic and barely steps away from s-expressions
<paroneayea>wisp does a good job of "hiding the parentheses"
<sbp>yeah. I'm not sure the premise, make a lisp which feels like Python, is a sensible one, especially when it's taken to mean "turn Wisp into Python". after all, you did an excellent job of showing exactly where and why the two languages differ, what their relative strengths and weaknesses are, and no amount of syntactic sugar will take away Wisps advantages or disadvantages over Python
<sbp>though it could give the appearance of having done so, which may not be a positive step
<paroneayea>I think it might be nice to provide a more python-like language to Guile, though I don't think it has to be Python exactly
<paroneayea>but
<sbp>on the other hand, I think that one of the reasons why Python is so beloved is that the language, the builtins, and the standard library considered together as an API are quite well designed—I would say more so than Scheme / Guile—and this may contribute to the relative popularity of Python over Scheme. a Pythonic interface to Scheme may therefore entice more people to switch
<paroneayea>sbp: I think the language thing is really true
<paroneayea>er
<paroneayea>library
<paroneayea>even more than language
<paroneayea>at one point I considered writing stuff in Clojure even though I don't like the JVM
<paroneayea>just because I wanted to *build* things with it
<paroneayea>that's the main reason Hy is interesting too, you can use sexps and write macros, but still use nice frameworks that come with it
<paroneayea>we need more libraries and frameworks in Guile
<ArneBab>I think that providing the feeling of Python has much to do with lots and lots of polish, using its own features in a consistent way everywhere and well, yes, libraries.
<sbp>I think it's a reason why people like Go, too. and, increasingly, Rust
<ArneBab>Libraries are what people actually use in the end.
<paroneayea>I hit the same wall with common lisp... too hard to actually do anything
<sbp>compare, for example, Lua. it doesn't have anything. Lua has some *amazing* and very compelling advantages—LuaJIT is an astounding piece of work, giving Lua Go-like performance, and lua.c being embeddable and microprocessor friendly is a real strength—but it just feels too ancient in terms of the syntax design and the meagre library that you get
<ArneBab>a good language makes elegant libraries easy to write, but if people invest much more work in a less elegant language, that will win (at least on the short term)
<paroneayea>Guix and Sly have helped keep me motivated with Guile, both projects that I think have good promise to give people reasons to expand the language if they succeed :)
<ArneBab>having Guile as the actual extension language for most GNU programs would help quite a bit, I think.
<sbp>Sly is davexunit's project?
<paroneayea>yes
<sbp>how is emacs-guile coming along?
<paroneayea>ArneBab: It could help a bit, but not as much right now honestly as an "out of the box nice to use web framework with tutorials"
<paroneayea>sbp: it runs, but no new commits for a while
<sbp>why no new commits for a while?
<paroneayea>I think the new website sirgazil is working on
<paroneayea>could help a lot too
<paroneayea>one thing Python does well
<paroneayea>welcomes newcomers of all types with open arms
<ArneBab>paroneayea: yes…
<paroneayea>the lisp world doesn't exactly have a good history of that I'm afraid :\\
<ArneBab>making it easy to start and actually do things is quite important
<paroneayea>it might be nice to have a "starter kit" for emacs that's tuned for Guile out of the box, maybe with some keybindings closer to other languages
<ArneBab>though I experienced #guile as pretty welcoming — even when I came with this wacky idea of making an indentation-based parser :)
<paroneayea>DrRacket has helped a lot of people come up to speed with lisp syntax
<paroneayea>ArneBab: yes I agree, #guile is great
<paroneayea>it also helps that Guile has three very friendly co-maintainers! :)
<ArneBab>definitely!
<paroneayea>we have a good baseline friendliness, but we do need to do more to make Guile look attractive to newcomers and then help them get up and running.
<ArneBab>the documentation is pretty good in most places, but often not that easy to find.
<sbp>not just newcomers, but also second- and n-languagers
<paroneayea>sbp: yes true
<paroneayea>ArneBab: I agree, the Guile Reference Manual is an amaaaazing resource, and I have learned so much about programming *generally* from it, though
<paroneayea>there is a high barrier to entry on it I feel like
<paroneayea>once you get past it it's rather easy
<paroneayea>that is how it felt for me, at least
<sbp>there needs to be a reason for people to learn a language, most people learn because they're forced to (work, university, etc.) or because they need to achieve a particular thing (fast? use C. maths? use FORTRAN or Julia, etc.)
<sbp>one of the things that ArneBab seems to be underlining in py2guile is that macros and DSLs really transform the way that you program, which is something that you don't get in Python. but you do get it in Hy, for example...
<ArneBab>it’s also important to keep in mind that this is dangerous
<ArneBab>it can lead to code which other people cannot read anymore
<sbp>yes, I saw your Shakespeare article... :-)
<ArneBab>
<ArneBab>macros are extremely powerful, but they need to be used with the appropriate care
<paroneayea>sbp: Hy is cool stuff
<paroneayea>sbp: I used to be reasonably active in it for those reasons...
<paroneayea>though
<paroneayea>it's super hard to debug :(
<paroneayea>it loses track of line numbers because of macro expansion, and in a sense "line numbers are all you have" when it comes to debugging python
<paroneayea>that and print debugging, but a person should not live on print debugging alone
<sbp>yeah, and it's a bit complicated internally for obvious reasons
<ArneBab>sidenote: after reading “hundred thousand lines” in Dylan, I checked wisp, and the parts which provide the actual functionality are less than 1000 lines of code.
<paroneayea>ArneBab: btw, one way to maybe get around the "running in wisp at a repl is kind of frustrating for alignment reasons" thing I mentioned, though it might be nice to also provide for non-emacs users, could be to add a M-x run-wisp to emacs
<paroneayea>which automatically does the indentation alignment
<paroneayea>similar to what geiser does for scheme
<ArneBab>that would be cool, yes
<ArneBab>essentially wisp as parser is working pretty well, but the tooling is severly lacking
<ArneBab>and that’s the next logical part which needs to be improved: It’s possible to just run wisp, now it needs to become fun to use.
<paroneayea>ArneBab: yeah I agree!