<nalaginrut>davexunit: sorry I realize I'm in wingo 's wip-particles branch, so it's not the latest <davexunit>okay. glad to have it resolved. got me worried, there. <davexunit>I was wondering: is guile-2d broken on every machine but my own? :( <davexunit>interesting. you should be able to quit via pressing ESC or Q <nalaginrut>and I killed guile process, then guile-2d window still there <davexunit>okay, first thing: did the demo work at all? <davexunit>did you see an animated sprite in the center of the window? <nalaginrut>I typed that in console, I should do it in X window <davexunit>guile-2d requires >= 0.5.0, but last I checked it doesn't crash with the previous release. <davexunit>which lead to me wasting an entire evening on a bug hunt. <davexunit>glad you like it. a lot of rough edges still. <davexunit>did you have any issues installing guile-figl? <davexunit>I guess guile compilation can't be parallelized right now. <nalaginrut>well, in my Ragnarok project, I can use make -j3 <nalaginrut>I think there's some dependencies problem in modules, dunno <nalaginrut>when I saw animation.scm of master, I can't understand where was sprite called <davexunit>but there's some good stuff here. like by default, there are callbacks that will close the window when you like click X or press ESC or Q. <davexunit>so that when you're writing quick programs you don't have to wire it all up. <davexunit>it's in the TODO list... along with many other things. <nalaginrut>events, images, animation, font, and sound needed <davexunit>I have events, images, animation, and fonts. <davexunit>I think I just need to add some layer over SDL's sound addon. <davexunit>now that I have 35 stars on my repo, I better deliver some functionality. :P <davexunit>I've never had a project that interested as many people. <nalaginrut>yes, I thought Artanis is the most faved one, till I saw guile-2d <davexunit>I promote it on 4chan, and someone posted it to r/scheme <nalaginrut>anyway, Artanis hasn't have a release, so I didn't pub/annource it <nalaginrut>when we have MVC/ORM and cli tools, I'll announce it <davexunit>MVC and ORM. those are going to take a lot of work! <davexunit>especially the ORM. are you aiming for ActiveRecord style stuff? <nalaginrut>yes I planed so, but I wonder if there's better way for that, papers? <davexunit>activerecord is cool, but there's definitely some problem areas <davexunit>the problem is that it's easy to write a pretty ActiveRecord query... that translates into terrible SQL <nalaginrut>davexunit: you mean the 'sql compiler' of ActiveRecord is not an optimized one? <nalaginrut>I my mind, it a thing compiling rails syntax to SQL <davexunit>my point is more that the abstraction can hide some performance issues. <davexunit>for instance, let's say we have 2 models. Users and Profile. Every User has a Profile. <davexunit>this is a bad example, because we could just be doing: Profile.all <davexunit>but here's the point: That line of code does 1 query from all of the user records, and then n more queries for each profile, where n is the number of users. <davexunit>User.all.include(:profile).map(&:profile) would do it in 1 query. <davexunit>I guess this a problem with ORMs in general. <davexunit>since we're putting a layer of abstraction between the user and the database. <davexunit>alright, I think I am going to merge wip-scenes into master. :) <davexunit>I just added the ability to switch between scenes. <nalaginrut>my question is 'does pattern itself matter for such optimization'? <davexunit>there's a point where the abstraction breaks down <nalaginrut>anyway, I dream to find a FP way for relational-mapping, rather than ORM <davexunit>perhaps I should try to make a prototype sometime. ;) <nalaginrut>I want to build a higher level relational-mapping based on ssql <nalaginrut>it's a hard problem I faced, how to choose the pattern, then how to implement it <nalaginrut>if I can't find the first answer, I have to try ORM first <davexunit>yeah, better to make something than struggle with an idea that goes nowhere. <davexunit>maybe when artanis gets more users a solution will appear :) <nalaginrut>yeah, maybe, if so, maybe I should do MVC first, for attracting more users <nalaginrut>my wife used to be an animator/designer of webgames, we planed to write games, but never have a start.. <davexunit>but I want to be able to write the game scripts in Scheme. <nalaginrut>I ever thought using Guile for game script only, the rest is c/c++, but you know, I'd like to use Scheme only now <davexunit>but then I thought that it would be cool to use pure Guile. <davexunit>guile-2d will probably have a small C extension at some point. <youlysses_mbl>I'm actually quite excited for the future of guile-2d and it may be the driving factor of me porting guile to Android... though I am worried of the status of SDL2. <davexunit>to provide something like pygame, but better. <davexunit>I'm hoping that guile-2d will catch on and I can get some help implementing features and performance tuning. <nalaginrut>it would be better to run it on Android, is there any possible? <youlysses_mbl>Didn't someone say that porting guile-sdl to SDL2, rather than rewriting it completely. <davexunit>youlysses_mbl: ttn asked my opinion about that on the mailing list. <davexunit>I think it might be easier to start from scratch. <davexunit>and also use the FFI instead of a C extension. <davexunit>perhaps I will move to SDL2 if I can write my own small wrapper for the functions that I need. *youlysses_mbl is very optimistic, and excited for the Guile. :-) <davexunit>the people working on the VM and compiler are smart <davexunit>and people like us writing cool libraries :) <youlysses_mbl>But yeah, same sentiments on this end. Peace out for now though. <davexunit>doing some of my first live-coding with guile-2d. <nalaginrut>davexunit: you don't sleep? what's your timezone? <davexunit>I took the day off from work tomorrow. taking a long weekend. <civodul>you can already do that with (define 2) <civodul>at the REPL you can do the above, then (+ 3), but not just <nalaginrut>unknown file:1:0: source expression failed to match any pattern in form (define 1) <civodul>are you sure you typed the non-breaking space? <civodul>nalaginrut: are you sure you typed the non-breaking space? <dje42>(gdb) scm (display ((@@ (gdb) lookup-type) "struct s")) (newline) ***anderson is now known as Guest24316
<nalaginrut>I always want to avoid OO in Artanis, but it seems so hard for relational-mapping <dje42>Calling Scheme from gdb to lookup type "struct s". <dje42>The @@ is just because lookup-type isn't exported yet. Should be: scm (lookup-type "struct s") <dje42>scm is a new command, akin to the existing python command. <dje42>It's in a sandbox of mine, dunno when it'll get into FSF gdb. <taylanub>Ah I see, so this is just a GDB extension/plugin or so using Guile, providing a Scheme API to GDB functionality, right ? <taylanub>Is the (gdb) module also available and usable from Guile itself, or does one have to use a GDB process that embeds Guile ? <dje42>gdb isn't a library, not yet anyway, so yeah - the latter. One has to start gdb. *taylanub just started work. <nalaginrut>since I can't avoid OO in ORM, I'm trying to write all design-patterns examples of Guile... <nalaginrut>who's the hero to teach me get rid of OO totally? ***ijp is now known as ijp2
***ijp2 is now known as ijp
<nalaginrut>is there anyway to make a method of class be protected? <nalaginrut>I know #:allocation #:each-subclass does similar thing, but it seems no fit for method but attribute <ijp>goops has no notion of method attached to a class <ijp>methods are a separate entity <ijp>you could choose not to export it, but that's still not protected in a meaninful sense <ijp>because it's closer to private than protected, and it's still really easy to access <nalaginrut>I don't know why use protected, IMO, it just avoid to call it by mistake? <nalaginrut>If I want to call a function anyway, there's method <ijp>it's for internal procedures that may be useful to a subclass <nalaginrut>for subclass I would add a call-protected with @@ <ijpbot>help COMMAND : returns the documentation for COMMAND <ijp>typical aidalgol isn't on when I have some Cool New Features™ <ijpbot>You need to be my master to do this "ijp" <add^_>ijp: design tip, don't make it spam out stuff, like a list of commands. <ijpbot>You need to be my master to do this "add^_" <ijp>hmm, dunno where the " comes from though, probably a bad format <add^_>Is the code hosted somewhere? Like, github? <ijp>it's on aidalgol's bitbucket, but I have a lot local <ijp>there's more on the plugins branch <ijp>hold on, I'll push what I have <nalaginrut>I wrote factory pattern in Guile according to GoF, but I still don't get why I have to do so with Guile ;-/ <ijp>nalaginrut: in goops, factory = not using 'make' <ijp>add^_: if you look now, you'll see (roughly) what I have at HEAD <nalaginrut>since we have first-class function and dynamic type, I don't know if it's worthy to write like this <ijp>if at any point, you are not specifying the type explicitly, you have a factory <ijp>it's actually really common in scheme <ijp>s/explicitly/explicitly when constructing an object/ <nalaginrut>I could write Factory just one line (define-method (factory-create klass . args) (apply make klass args)) <ijp>that's not a factory <ijp>(define-method (factory-create . args) (apply make klass args)) would be a factory <nalaginrut>since we don't have to define a brand new class for produce new classes <ijp>if "everything is a class" then obviously you need to attach a factory method to a class <ijp>but scheme isn't that way, you can have standalone functions <nalaginrut>we can overload a generic function without any 'mother class' <nalaginrut>I think the factory class is needed because OO language has to define a class then overload its methods <add^_>Actually, ijp, you and aidalgol could work on guile-irc to improve that, and make the bot from there ;-) <add^_>Not that you need to do that now, now that you've already made a bot. <ijp>well, I did say about 2 years ago that there were about 5 different people doing this <add^_>There are more than one? *confused* <ijp>I've said it about a lot of things <add^_>It's nice to see you've gotten a bot together <add^_>More bots to take over the world! *nalaginrut is a bot, actually <ijp>people ask me if I'm a bot at least once a week *nalaginrut will add auto-reply "no I'm not" to ijp bot <ijp>the response I use, which I believe I stole from fsbot, is "I am an organic" <ijp>add^_: you could take it up with aidalgol, he might be happy to get rid of the mess of regexps <add^_>guile-irc needs some fixing up (again) to be easier to use <civodul>add^_: was there any release of guile-irc? <civodul>maybe you should run a name contest too ;-) <ijp>guile's uniquely intelligent loquacity engine <civodul>but the acronym still wouldn't be very original <ijp>then, how about the Library for Irc Networking UniX <Arne`>Why doesn’t scheme allow for adding strings? (+ "ab" "cd") — having to explicitely use (string-append "ab" "cd") feels overly complex after knowing python… <ijp>because string addition is not commutative, and therefore not really addition <civodul>or: (let ((+ string-append)) (+ "a" "b")) <civodul>and now it no longer feels "overly complex" ;-) <Arne`>(googlability of the manual would rise massively if the chapters would note the use-modules command needed to use them… <ijp>the majority of them do <ijp>and goops does at the beginning of its chapter <Arne`>I found it by pressing UP :) <ijp>I need to sit down one of these days and come up with a solution to ad hoc polymorphism I actually like <ijp>for functional programming* <Arne`>why isn’t that behaviour the default? Is the default defined as “bare scheme”? <ijp>Arne`: because scheme doesn't have ad-hoc polymorphism <ijp>which they won't add because 1) it isn't primitive 2) there is no one clear cut way to do it <Arne`>civodul: let doesn’t actually solve my problem: I could also use string-append, but I don’t want to have to remember it. <ijp>but you remember a non-standard use of + ? <ijp>and one which is incorrect from an algebraic point of view <Arne`>+: “I want to add up something” <ijp>for instance, if I wrote the following code (define (sum3 a b c) (+ b a c)) <Arne`>ijp: My experience with Python shows, that this works really well. <ijp>this is absolutely correct according to a mathematical understanding of + <Arne`>so you should only use it with numbers… <ijp>but then you've just undermined your own argument <Arne`>or rather: If you gave that to someone else he or she would rightfully complain that this is not generically useful. <ijp>it is generically useful <Arne`>ijp: No: Your function should only be used with number, but that does not hold for + itself. <ijp>it works for every commutative monoid <ijp>now, at this point, I'm taking the piss <ijp>but it reminds me of the common argument that lisp is bad for not doing infix arithmetic <Arne`>I would reply to that with (nfx 1 + 2) <ijp>and yet most of those same languages * and / are not inverses <Arne`>Those languages are often used for much different tasks then math. <Arne`>In python I often used 5 * "a". It was perfectly clear what that should do. <ijp>anyway, the point is, mine is not less general than yours, it generalises differently <Arne`>your (sum3) keeps the expectations for numbers, but it is surprising for strings. <ijp>for instance, both of ours accommodate booleans <Arne`>The key point I see is to find commonly understandable notations which fit as many operations as possible. Essentially to find a minimal language to express most tasks. <Arne`>But since goops allows me to add that, I’ll just have to remember to use that when I do string-work. <ijp>sigh, you don't get it <Arne`>I get that there is a specific reason why + does not work on strings by default. I just do not agree that this reason is more important than having a minimal set of functions to use when working on problems. Those are two different requirements. <ijp>actually, we have covered 3 things <Arne`>ijp: which ones? (I thought I’d ask after waiting >10min for the next line :) ) <ijp>1. scheme only defines + over complex numbers <ijp>2. alebraicists use + to define commutative binary operations <ijp>3. some langauges also use + for concatenation <Arne`>and actually the first example for generics in GOOPS is string-concatenation, so 3 seems pretty obvious. <Arne`>also 2 isn’t given in scheme: (+ …) is much more general than a + b. <Arne`>and the same is true for string-append… <Arne`>so using 2 as an argument against string-concatenation with + feels a bit awkward. <ijp>well, the extensions to + for 0 1 and >2 arguments are valid algebraicly <ijp>what I am saying is, your assertion that one is "obvious" only true if you ignore it's conventional usage amongst mathematicians *Arne` avoids going too deep into math-notations. <ijp>which, you can do, by all means, but it's important to rember that "obvious" is in the eye of the beholder <icelesstea>As I see it, the "biggest issue" with using + for string concatenation, is that you then have to take more care with what you give + as arguments. With separate string-append it's more explicit. (Sorry for randomly butting in) *Arne` forgot too much from the lectures to corrrectly speak about subspaces with relaxed conditions and such… <Arne`>icelesstea: because you won’t have type-checking? <ijp>Aren`: no, because string append is ordered <icelesstea>If a mistake can be made, it's quite certain some people will from time to time make it, and this can cause some rather peculiar behaviour and bugs in code. <ijp>for me, this is one of the reasons I have trouble with global mutation based polymorphism <ijp>which is how goops works <ijp>because the assumptions I made in my code can be broken by someone else whose module has no interaction with mine <icelesstea>Precisely. And this effectively breaks the black box idea of procedures/functions. <Arne`>ijp: so when I define (+ …) in my code and a module uses it, that module gets the additional capability to concatenate strings with +, which might break its error checking? <ijp>Arne`: well, maybe, maybe not, it depends on the code <ijp>you've used it in python, you know what the deal is <ijp>if you only define, say, string-string concatenation, there is less chance for error, than if you, say, coerced numbers to strings, and appended <ijp>then, "foo" + 3 might give you "foo3", but 3 + "foo" gives you an error <ijp>wingo: the string-trepanation yesterday, this today, is something at work fuelling your choice of rants?? :) <wingo>ijp: dude, you don't even know... ;) <wingo>today i spent three hours debugging this: <ijp>where foo is unbound? <wingo>turns out some things just print as null <Arne`>ijp: What I now defined for myself is string-string concatenation and an explicit error for string-number and number-string. <ijp>the other issue I can foresee is if someone else _also_ redefines those <Arne`>ijp: In python string concatenation everywhere with + does not create any problems (I know of), because programmers expect that to be the default. <davexunit>I have a rect-contains? procedure, and I want that procedure to either take 2 arguments, x and y, or a 2D vector. <ijp>well, one example would be mean(["foo","bar","baz"]) <Arne`>ijp: There’s something I don’t understand, though, which the knowledge you seem to have of GOOPS could help untangle (I take your distaste for knowledge): <Arne`>(define-method (+ (x <string>) (y <number>)) (throw 'mixed-strings-and-numbers)) <davexunit>(rect-contains? world-bounds (bullet-position b)) throws the error ERROR: Wrong type to apply: #<syntax-transformer bullet-position> <ijp>the obvious definition of mean works for any field, but would fail for strings <ijp>Arne`: you could just leave it unbound, and it should be fine <ijp>davexunit: huh, I don't see why that would be an issue there <davexunit>found the problem. bullet-position is defined *after* the procedure that calls rect-contains? <ijp>actually, the earlier statement about mean is false *ijp tries vainly to remember what it is he is supposed to be doing <ijp>hmm, actually, I can think of a way to make the definition of mean work, but it's <ijp>not going to be very useful, I think ***dsmith-w` is now known as dsmith-work
<ijp>see, it makes perfect sense! *ijp twirls moustache evilly <ijp>the smallest finite field, it contains 0 and 1 (here #f and #t) ***ijp` is now known as ijp