<Aurora_iz_kosmos>str1ngs: Was that in answer to my query? It's not quite what I meant. I mean more to interact with a service written in Go from Guile. <Aurora_iz_kosmos>Fair, I'd probably have looked for JSON first as I find it more pleasant to read. <str1ngs>but I'm not sure how you would handle the RPC on guile side. you could maybe start with a UNIX socket. <str1ngs>I had hoped to created a dbus service eventually do hand proper guile RPC. but my project is not at that stage yet. <str1ngs>eval and read would work, but the security implications of that.. <Aurora_iz_kosmos>You could have that as a mode, or otherwise using RPC handlers for specific calls. <str1ngs>Aurora_iz_kosmos: it's doable, be interesting to see what you come up with :) <Aurora_iz_kosmos>I'd probably use GOOPS anyway and explicitly register handlers. For simplicity's sake. ***drakonis1 is now known as drakonis
<rlb>(i.e. on savannah circa 2016) <rlb>And until you said it, I hadn't noticed 3.0.2 :) *rlb might attempt that this weekend -- we'll see. <dsmith>Building without the bootstraped .go files and without the jit is so tedious. <dsmith>Takes like 6 minutes to cross-compile on my 8core work laptop <rlb>Nice, though I suspect the ftp-masters would frown on such an approach for the debs :) <dsmith>Yes. And you must have all the deps available too. <rlb>I have thought about arranging an arch-specific deb (for one of the faster archs) that just contains the .go files, and then having the others depend on that, but that kind of indirect arch dependency is (unsurprisingly) not favored, and I think may have caveats. <dsmith>Yeah, it's not just the alignment. <dsmith>=> 0x73ba24d8: 04 f0 1f e5 ; <UNDEFINED> instruction: 0xf004e51f <daviid>lloda: hello! I am on stable-2.2, git clean -dxf, git pull, git fetch --all, now, admittedly not a very good git user, what is the easier way to apply your wp-exception-truncate patch? tx <daviid>lloda: I mean can I just merge those, are they (still) compatible with the stable-2.2 branch? <daviid>I don't thnk that would work, there are quite a lot more patches there then just exception-truncate, not sure others were made for 2.2 <retropikzel>How can I get the body out of (http-get "url") response? <str1ngs>copy-to-port is custom . you can use any port function <str1ngs>retropikzel: the tricky bit is receive if you have not used values before. but once you get use to the they are nice. ***wxie1 is now known as wxie
<lloda>hi daviid, wip-exception-truncate is rebased on master since that's what I use <lloda>but I have pushed a patch to branch stable-2.2-wip-exception-truncate which goes on top of 2.2 <lloda>since I don't use 2.2 I haven't tested it, but it should work <RhodiumToad>bleh. accessing a bytevector as big-endian u16 is tons slower than as native-endian u16 <mwette>dsmith: lost track ... doing all non-thumb ? <dsmith>The BLX <immediate> must be to 4 byte alignment. Actually, the branch offset must be aligned. <dsmith>Sometimes, there is a 2 byte alignment. <dsmith>Aligning the BLX op fixed almost all cases. <dsmith>But I'm still getting one somewhere. Almost looks like it's not the JIT code making it. <dsmith>mwette: I'm on Raspbian. Whatever that is. Thought it would be thumb, but I'm getting the errors. <dsmith>Here is my current illegal instuction: 0x73ba24d8: 04 f0 1f e5 <mwette>illegal in both modes (ARM and THUMB)? <dsmith>The 0xF0 at the start makes it a thumb <dsmith>Here's the thing. I'm logging *every* BLX that gets generated (calli in arm-cpu.c) <dsmith>And the failing one is not logged. <dsmith>So either something else is making it, or it's some other code that corrupting it. <dsmith>That not a 32bit thumb code. Is 16 bit <dsmith>There are only 4 immediate jump type 32bit codes. Bcond, B, BLX, BL. <dsmith>It's either a bad offset for a BLX, or a BL or B got corrupted into a BLX. *RhodiumToad further improves the performance of hex->bin <marmulak>what are we supposed to use the char-set type for? Because there is also 'string', and I was trying to write another example program yesterday that I imagined char-set might be useful for and then ended up hacking the whole thing together with strings only <RhodiumToad>char-set is useful for a lot of things, e.g. looking for delimiters <dsmith>marmulak: A char set is like [a-z] patter in regular expressions. <marmulak>isn't a string basically a set of chars ~_^ <marmulak>so the different types simpl have different functions associated with them? <marmulak>I imagine this helps with functions and optimization <marmulak>my other newbie question is, let's say I (read) input, and the input is a word like "cat" except it's not in quotes. What I gathered so far playing with guile is that if it's in quotes its type is string <marmulak>but without quotes I couldn't figure out its type <mwette>marmulak: char-set's provide a general way to predicates like char-numeric? <dsmith>(read) returns a "datum". An s-expression. <mwette>s/way to predicates/way to generate predicates/ <RhodiumToad>marmulak: if you're reading it with (read), then a word not in quotes is a symbol <dsmith>Well, *reads* the next one and returns it. <marmulak>RhodiumToad: a symbol is meant to be evaluated, right? <RhodiumToad>whether to evaluate it after reading it is up to you <RhodiumToad>and given those, for example (symbol? (car $1)) will be #t <marmulak>I know there's a lot of books and materials about scheme listed online, but do you guys know any particular book that introduces readers to these concepts for the first time like predicates and lambdas, folding, etc? Like, ELI5 <dsmith>RhodiumToad: Yes. Sorry. Thought it would be small enough.. *dsmith goes back to banging his head against the desk <rekado>marmulak: The Little Schemer builds up your understanding from the ground up. <rekado>it’s deceptively simple and sometimes annoyingly thorough. <marmulak>I have programming experience but I don't feel that I'm an experienced programmer. And I think from a compsci point of view I should strengthen my conceptual foundations <rekado>The Little Schemer tries to develop your intuition of Scheme. <rekado>It sometimes takes a little long before it will move on to other things <rekado>and sometimes the question/answer format seems to get in the way, but generally I think it’s a very good start. <rekado>you start from a handful of primitives and build your way up <rekado>by the end you should be very comfortable with lambda and what can be done with it. <marmulak>would you say, that scheme is a "powerful" language? <dsmith>marmulak: In Paul Graham speak, I'd say yes. (he talks about laguage power in his writings) <marmulak>a few days ago I joked in #guix that they should use haskell instead of scheme (part of the joke is implying they didn't have to fork nix). Maybe there is a technical reason to prefer scheme as a language, and some people responded with that type of answer. Their statements gave me the impression they considered scheme's strength to be related to some idea like power, completeness, or maybe flexibility <marmulak>not that I'm searching for technical definitions of these terms, but it'd help to know what proponents of scheme think is good about scheme <marmulak>and if there is something that makes scheme special, if there are other languages that also share that quality, whether in whole or in part <dsmith>It's functional when you need it, or imperative when you need it, or OO when you want that. <civodul>marmulak: the answer to this kind of question is always half-technical, half-social <civodul>(shameless plug, but hopefully gives some insight!) <rekado>I used to be a Haskeller, actually, but I always liked Scheme. (Nowadays I no longer write Haskell.) <marmulak>I have read this also about ML languages like ocaml <rekado>in my opinion, Haskell is lovely, but kinda inflexible at times, leading to lots of type-directed churn during development <rekado>sometimes I do miss compile-time type checking in Scheme <marmulak>scheme encounters type errors only at runtime? <rekado>there are alternatives to using the type system as the only compile time checks, though, such as enums etc. <rekado>procedures don’t have a type signature which would be checked by the compiler <rekado>there’s Typed Racket which has type signatures <rekado>and there are contracts, which serve a similar purpose. <marmulak>so far I'm finding scheme fun and easy (well as easy as an unfamiliar language can be). But at this stage in my learning I find myself writing the same imperative programs I used to in C <marmulak>racket seems kind of popular, though I never heard of it until recently <rekado>becoming familiar with map and fold and friends will likely change your style. <rekado>I’m now approaching most problems as some sort of data transformation <marmulak>I used map a little bit while trying to learn haskell. I felt its great utility but understood very poorly how it works <rekado>this makes me write small procedures that take an input in one format and return the input in a new format. <dsmith>When I started learning Haskell, I was delighted that my old frinds from Scheme where there (map, fold, ...) <rekado>map applies a procedure to all elements of a list and returns a new list. <rekado>fold is used to build up a data structure by processing a list item by item <RhodiumToad>if you really want to tie your brain into knots, try shift/reset <rekado>you use fold by defining a procedure that is called for every element of the list; the procedure takes the element and the intermediate return value up to this point. <rekado>this allows you to compute sums, count elements, filter lists, etc <rekado>fold is very versatile and it becomes easy once you recast your problems as data transformations. <dsmith>My "fix" for veneers is "ldr pc,[pc,#-4]" Which is *exactly* the same thing as the malformed BLX! <marmulak>do car and cdr stand for anything in English? <marmulak>this explains car and cdr, but it also mentions cpr and ctr <RhodiumToad>the car and cdr account for 30 bits of the 36-bit word, those other two were the remaining two 3-bit fields <RhodiumToad>which never became exposed at the programming level in the same way that car and cdr did <marmulak>shit, I would have understood the docks better if car and cdr were named something like head and tail <RhodiumToad>but the original names have proven hard to stamp out <RhodiumToad>that's the second element of a list which is the first element of x <RhodiumToad>a list like (1 2 3) is actually (1 . (2 . (3 . ()))) <marmulak>do there have to be spaces around the period <marmulak>so for pairs we also use car/cdr to get the first and second element <RhodiumToad>in most cases without spaces the . would be part of the adjacent value, unless there was some delimiter like a ) <RhodiumToad>car and cdr are specifically for dealing with pairs. a list is made up of pairs <marmulak>I see, I understood it kind of backwards <RhodiumToad>a list is either the special value () which is an empty list, or it's a pair whose cdr is a list <RhodiumToad>you can make s-expressions that are "improper lists", where the chain of cdrs ends in some atom other than () <RhodiumToad>e.g. formal parameter specifications are improper lists, like (lambda (a b . c) ...) <RhodiumToad>c in that example is a "rest arg", it's assigned a (possibly empty) list of all parameters after the second <RhodiumToad>lisp was about the 4th programming language I learned as a kid, maybe 14 or so <marmulak>it defines a function atom? that returns #t if (if I understood it) the input is not pair or null. I entered its definition into guile and it appears to be working as the book provided it <marmulak>but I suspected this function does what symbol? does in guile <marmulak>as far as I tested the results appear to be the same <RhodiumToad>e.g. (atom? 1) would be true, but (symbol? 1) would not <manumanumanu>marmulak: you can define the function atom to be true if something is not a pair or null if you want <RhodiumToad>manumanumanu: I got some more performance for hex->bin by simplifying that sparse array thing <manumanumanu>RhodiumToad: great! And I made your bin->hex a bit faster :D <manumanumanu>It is sooo little. Stable at about 2% difference by just porting your bin->hex stuff to my old implementation. <manumanumanu>RhodiumToad: but looking at the code, there should be no difference. You bind an extra variable for the loop check through your macro, but that should be inlined <RhodiumToad>yeah, the binding isn't really necessary in this usage, it's just that numeric-for is written for general use <manumanumanu>I have a more or less feature complete implementation of racket's for loops btw <manumanumanu>I use it mostly for repl stuff where named lets quickly become unwieldy <manumanumanu>It is not as powerful as foof-loop, but has (imho) a simpler syntax. <manumanumanu>but I don't know whether foof loop can do a lazy right fold, which my for loops can <RhodiumToad>one thing I tried was exploiting the fact that guile allows uniform-vector ops on bytevectors. but that actually made it slower <RhodiumToad>that saves all the uses of 2*, but somehow it ended up slower overall <manumanumanu>RhodiumToad: guile does a lot of unboxing magic with bytevectors iirc, which might be it <manumanumanu>RhodiumToad: do you have any changes coming, or would you mind a patch for supporting upper/lower case and delimiters? ***rlb is now known as rbl
***rbl is now known as rlb
<rlb>With the provided GUILE_PKG automakery and given say GUILE_PKG([3.0 2.2]) in configure.ac, is there an easy way to pick 2.2 for a given configure invocation when both are available, i.e. something like ./configure --with-guile=guile-2.2? <rlb>(Use case is building a tree twice to test both flavors.) <mwette>maybe ./configure GUILE=guile-2.2 <rlb>...looking at aclocal.m4 seems like maybe not, unless I were to create my own "shadow" PKG_CONFIG_PATH/LIBDIR or similar that didn't have 3.0. But for now I may be able to just not use GUILE_PKG and instead do the important bits of what it does directly. <mwette>how about ./configure GUILE_EFFECTIVE_VERSION=2.2 <rlb>mwette: yep, brilliant. Looks like that may work. Thanks. <rlb>New 2.2 and 3.0 debs have been uploaded that are intended to allow multiple guile-X.Y-dev packages to be installed at the same time (hence the questions I was asking). <manumanumanu>rlb: does that mean guile-3 is coming to a debian-based distro near me? <manumanumanu>which is great, since I just got a new linux server. 6 cores ready to build! I don't have to do stuff on my odroid-xu4 anymore :D <manumanumanu>then I can just update ubuntu on that one and have an official package