lexi-lambda changed the topic of #racket to: Racket v7.1 has been released: http://blog.racket-lang.org/2018/10/racket-v7-1.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
pera has joined #racket
soegaard has quit [Quit: soegaard]
zmv has joined #racket
zmv is now known as notzmv
<rlavery> My quadtree implementation is about as done as I'm going to make it. This was fun. http://pasterack.org/pastes/87699
<aidalgol> rlavery: That's some nicely readable code!
<rlavery> Thank you!!! It is the most complex thing I have done in a functional or typed language, it was a very satisfying journey
notzmv has quit [Ping timeout: 244 seconds]
<aidalgol> I know the feeling.
<aidalgol> Have you used untyped racket, or did you go straight to typed racket?
<aidalgol> I haven't yet tried typed racket.
<rlavery> I got started last weekend, I switched to typed racket after two implementations of Conway's Game of Life because I was curious if it would improve performance
<rlavery> (It didn't, because the data structure I was using-- a flat list-- has abysmal performance for random access)
<rlavery> Funny enough my first try at it in untyped racket is still the most performant one, that one used a vector of vectors for its point data
<rlavery> but now that I finished up my quadtree implementation i'm going to see how well I can implement GoL on it
pera has quit [Ping timeout: 246 seconds]
<rlavery> I didn't want to spoil myself, so I didn't look at dented42's quadtree implementation until now. I can confidently say I still have a long ways to go when it comes to types.
bor0 has quit [Quit: Leaving]
ubLIX has quit [Quit: ubLIX]
keep_learning_M has quit [Quit: This computer has gone to sleep]
pera has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
iyzsong has joined #racket
keep_learning_M has joined #racket
ng0_ has joined #racket
ng0 has quit [Ping timeout: 256 seconds]
rlavery has quit [Quit: Page closed]
ng0_ has quit [Client Quit]
dan_f has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
aidalgol has quit [Remote host closed the connection]
zmv has joined #racket
zmv is now known as notzmv
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 246 seconds]
dan_f has quit [Quit: dan_f]
aidalgol has joined #racket
notzmv has quit [Ping timeout: 258 seconds]
rlavery has joined #racket
_whitelogger has joined #racket
zmv has joined #racket
zmv is now known as notzmv
dan_f has joined #racket
dan_f has quit [Quit: dan_f]
<rlavery> I got Conway's Game of Life going with my toy Quadtree implementation. Starts slow, but overtakes my last implementation after about 100 frames. http://pasterack.org/pastes/15550
notzmv has quit [Ping timeout: 250 seconds]
jao has quit [Ping timeout: 245 seconds]
iyzsong has quit [Ping timeout: 258 seconds]
pera has quit [Quit: leaving]
FreeFull has quit []
_whitelogger has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 245 seconds]
notzmv has joined #racket
Arcaelyx has joined #racket
<lavaflow> from the manual: "If a thread is terminated while applying hash-ref, hash-set!, hash-remove!, hash-ref!, or hash-update! to a hash table that uses equal? or eqv? key comparisons, all current and future operations on the hash table may block indefinitely."
<lavaflow> can anybody explain to me what the underlying cause of this would be? and how I might avoid this?
<lavaflow> hmm, I'm guessing those operations take the semaphore, and if the thread is killed before they complete, it's never released
<lavaflow> why equal? hashes and not eq? hashes though?
<lavaflow> maybe the solution is for me to use breaks instead of kill-thread, and disable breaks during those hash operations.
dddddd has quit [Remote host closed the connection]
Arcaelyx_ has joined #racket
notzmv has quit [Ping timeout: 255 seconds]
<lavaflow> that seems to have done it
Arcaelyx has quit [Ping timeout: 250 seconds]
Sgeo_ has joined #racket
Sgeo has quit [Ping timeout: 250 seconds]
zmv has joined #racket
zmv is now known as Guest35324
Guest35324 is now known as notzmv
Sgeo_ has quit [Read error: Connection reset by peer]
Sgeo_ has joined #racket
YuGiOhJCJ has joined #racket
aidalgol has quit [Remote host closed the connection]
aidalgol has joined #racket
evdubs_ has joined #racket
evdubs has quit [Ping timeout: 250 seconds]
q9929t has joined #racket
soegaard has joined #racket
ubLIX has joined #racket
q9929t has quit [Quit: q9929t]
Fernando-Basso has joined #racket
q9929t has joined #racket
q9929t has quit [Client Quit]
orivej has quit [Ping timeout: 272 seconds]
orivej has joined #racket
Arcaelyx_ has quit [Ping timeout: 272 seconds]
notzmv has quit [Ping timeout: 245 seconds]
Sgeo__ has joined #racket
Sgeo_ has quit [Ping timeout: 246 seconds]
amz3 has joined #racket
<amz3> hello, how does racket do docstrings?
<soegaard> It doesn't.
<amz3> hey soegaard
<amz3> so racket doesn't have a way to extract documentation from code
<soegaard> That's different.
<soegaard> But there is no standard way.
<soegaard> However the tradition is to write "proper" documentation.
<soegaard> Personally I hate this type of documentation: https://www.cairographics.org/manual/cairo-cairo-scaled-font-t.html
<bremner> the only thing worse than bad documentation is no documentation
<bremner> that thing about docstrings is it avoids the no-documentation case
ZombieChicken has quit [Ping timeout: 256 seconds]
<soegaard> It works well in Emacs.
<amz3> soegaard: that is a reference documentation, it has is nice sides, I even think it is required documentation. What you don't like about it?
<soegaard> The bigger picture is missing.
<soegaard> cairo_scaled_font_extents ()
<soegaard> Gets the metrics for a cairo_scaled_font_t.
<soegaard> Okay - what is "the metrics" ?
<soegaard> No explanation - not clear where to go.
<amz3> that is cairo_font_extends_t struct in this case, but yeah, it is not perfect
<amz3> in that case the documentation does not say that 'extents' is the output of the function
<soegaard> I can figure that out. But what is it computing?
<soegaard> Also the list of functions will either appear alphabetically or in the order they happen to be in the source code.
<soegaard> It ought to be grouped in a manner that makes sense for whoever reads the documentation.
<amz3> in Python noosphere, they say documentation is two (maybe three) sides, one documentation side is the reference / procedure index where each function / method / class is documented another side of the documentation is the 'story' how objects work together and the third documentation side is "how to get things done" kind of documentation aka. topical documentation
<amz3> (I mention Python because that is what I know, I hope it's not perceived badly)
<amz3> and from what I have seens that is what racket documentation does
<amz3> s/seens/seen/
<amz3> the good thing with docstrings is that it very easy to in REPL to get to know what procedure is supposed to do, that problem has other solutions tho.
<soegaard> That's a nice way of doing it - but there is a tendency never to write more than the automatically generated docs.
<soegaard> (referring to your first point)
<soegaard> I can't find anything good on Cairo for example.
<soegaard> Look at Neils packages.
<soegaard> I think he has something.
<soegaard> mcfly
<bremner> fwiw, drracket and racket-mode have some features to automatically look up documentation in the reference manual
<bremner> so the user facing convenience is still possible
<amz3> that is what I was thinking, you can generate an "index" from a documentation (with the correct semantic hints) to help the REPL or whatever editor one use
<amz3> tx for this insightful conversation
davidl has quit [Ping timeout: 258 seconds]
keep_learning_M has quit [Quit: Leaving]
dddddd has joined #racket
jao has joined #racket
davidl has joined #racket
quipa has joined #racket
ng0 has joined #racket
ubLIX has quit [Quit: ubLIX]
_whitelogger has joined #racket
Sgeo__ has quit [Ping timeout: 255 seconds]
Sgeo has joined #racket
davidl has quit [Quit: WeeChat 2.2]
choiboi has joined #racket
<choiboi> Does racket have a package manager like pip or quicklisp?
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
<s455wang> choiboi: https://docs.racket-lang.org/pkg/index.html and see section 3
Fernando-Basso has quit [Remote host closed the connection]
dancek has quit [Ping timeout: 258 seconds]
<choiboi> s455wang: thank you
jao has quit [Ping timeout: 240 seconds]
barbes has quit [Ping timeout: 250 seconds]
<choiboi> for writing strings with unicode to terminal what write method is prefered?
<soegaard> Does `display` not work?
<choiboi> display works but it seems there is so many ways to write to the terminal so I didn't know if there is a prefered method for that case
dancek has joined #racket
<choiboi> Why does this return an error? http://pasterack.org/pastes/14940
badkins has joined #racket
quipa has quit [Read error: Connection reset by peer]
FreeFull has joined #racket
choiboi has quit [Quit: WeeChat 2.3]
dan_f has joined #racket
choiboi has joined #racket
juanfra has quit [Quit: juanfra]
casmajavi has joined #racket
casmajavi has quit [Remote host closed the connection]
dan_f has quit [Quit: dan_f]
juanfra has joined #racket
jao has joined #racket
choiboi has quit [Quit: leaving]
<rlavery> I'm getting the "instantiate: unknown module" issue when trying `raco exe` from the command line or 'Make executable' from the DrRacket gui with Racket 7.2.0.5--2019-02-15(edeae791ab/a). I can see on the mailing list people had this issue in 2015 and it looks like a snapshot build wound up fixing it for them, so I'm not sure if there's something I'm doing wrong. error: http://pasterack.org/pastes/90931
choiboi has joined #racket
<rlavery> choiboi: your define should look like `(define (rprintf x) (printf x))'. It is trying to evaluate `x' on its own since you put it by itself in parentheses.
jao has quit [Read error: Connection timed out]
jao has joined #racket
<choiboi> rlavery: but then it doesn't return its input
<rlavery> in that case you can do this:
<rlavery> `(define (rprintf x) (printf x) x)'
<choiboi> rlavery: thank you so much!
<rlavery> the problem was the parentheses around the last x. it was causing Racket to try to evaluate x as a function
<choiboi> rlavery: so if I want it to just return a value I leave it out of parenthesis
<rlavery> yeah, without parentheses just returns the literal value, while with parentheses is a function application.
<choiboi> rlavery: awesome thank you so much
<rlavery> np! :)
Arcaelyx has joined #racket
<J_Arcane> I cannot seem to curl the minimal Racket installer script?
<J_Arcane> if I do "curl -s https://download.racket-lang.org/releases/7.2/installers/racket-minimal-7.2-x86_64-linux.sh", I get an empty response instead of a file, though wget works fine.
<rlavery> Try `curl -L'.
<rlavery> -L tells curl to follow redirects which I think wget does by default.
<J_Arcane> also, is there an option to run the installer script noninteractively.
<J_Arcane> rlavery: awesome, that works.
<J_Arcane> I'm trying to automate a Racket installation, so I'd like to somehow be able to just install it automatically to .local or equivalent
<rlavery> ` sh linux.sh --in-place --create-links . --dest`
<rlavery> err, sorry
<rlavery> --create-links and --dest both take paths
<rlavery> you can run the installer with `--help` too
<rlavery> it is a little more coherent than me right now sorry
<rlavery> but those flags handle all the questions it asks when run interactively and if they are all passed it just works (as per my test just now)
<rlavery> The argument passed to `--dest` is for a folder that will be created with `mkdir -p`-like functionality (with the exception that it will ask for input if the directory already exists)
<J_Arcane> cool. Thanks.
<rlavery> np!
<J_Arcane> now to see if I can get Glitch to actually cooperate with it. :D
<rlavery> I haven't used Glitch before! What does it do?
<rlavery> I still haven't figured out my 'unknown module' issue. I have a feeling it will work if I swap over to untyped racket but I don't feel like removing all the type annotations lol
<bremner> rlavery: isn't there a way to shut off the type checker but keep the syntax?
<bremner> something like typed/racket/untyped ?
dieggsy has quit [Quit: ZNC 1.7.1 - https://znc.in]
<J_Arcane> rlavery: it's sort of like a live pastebin meets a hosting service meets an online IDE. You get a container and an editor, and it's set up so you can write web apps and they'll be automatically deployed and hosted as you make changes
dieggsy has joined #racket
<rlavery> oh wow. that sounds extremely convenient and like a security nightmare :)
<rlavery> bremner: thanks, will give that a shot!
<J_Arcane> rlavery: well, in theory it's all just running in a little Docker container essentially, with very limited access rights and resources
<rlavery> the question is, are those Docker instances running as root? :D
<J_Arcane> nope.
<J_Arcane> they're configured to only run as a local user. you don't even get apt access
<J_Arcane> otherwise I might just do "apt install racket" XD
<rlavery> haha
casaca has quit [Read error: Connection reset by peer]
<J_Arcane> hmm. next question may wind up being "now how do I install the 'web-server' package to minimal racket with raco without installing the entire full Racket suite and burning all the disk space on my container..."
<soegaard> bremner: yes - but the names escapes me for the moment
<soegaard> bremner: unsafe-require/typed ?
<J_Arcane> yep. that is the question. how can I install 'web-server' without also installing all of the full Racket distribution. It seems unlikely that I need DrRacket just to run that.
<rlavery> I think bremner was thinking of typed/racket/no-check
<bremner> soegaard: not sure, it's rlavery who thought it might be useful at the moment
<rlavery> j_arcane: yeah it has a bazillion dependencies, idk why the gui is a dependency of the webserver
<bremner> yes, that annoys me for the handin server
<rlavery> bremner: oh wow typed/racket/no-check worked
<J_Arcane> rlavery: damn. Probably won't work on this then. Glitch container is too small for a full installation.
<bremner> rlavery: great.
<soegaard> Oh - missed the first part.
<rlavery> @j_arcane aaahhhh web-server-lib is what you're looking for I think. doesn't break the bank on space, doesn't have docs and gui as dependencies
<J_Arcane> rlavery: ahh, that might do.
<rlavery> I'm still curious why this exe won't compile as typed/racket.
<J_Arcane> rlavery: hah! Hot damn, I did it.
<J_Arcane> You were right, web-server-lib was the way to go. Just squeaks by the storage limit.
<rlavery> J_Arcane: Nice work!
endformationage has joined #racket
<J_Arcane> rlavery: if you want to see what it's like, you can check it out live here: https://glitch.com/edit/#!/rantstack
bartbes has joined #racket
jao has quit [Ping timeout: 244 seconds]
jao has joined #racket
zmv has joined #racket
zmv is now known as notzmv
<rlavery> J_Arcane RantStack was fun to read, but then I got sucked into reading some of your slides and other things on Glitch. I loved your description of "Why don't you learn Lisp?" as the "most career-changing practical joke"
<J_Arcane> :D
<rlavery> I am very very pleased to have finally caught a Lisp-Type
<rlavery> my Rubosaur will be by my side all of my days, but Racketzard is moving up the ranks at lightspeed
<J_Arcane> it is thanks to that unwittingly absurd suggestion that I've now got a job doing Haskell of all things
<rlavery> I have spent exactly enough time trying to learn Haskell to miss set comprehensions in other languages
<rlavery> now that Racket took the scales off my eyes, I'm planning on giving ghci a thorough workout to see what's more intuitive to me now
<J_Arcane> it seems that when you tell people you know about functional programming, they assume you must be very clever, as opposed to simply too daft to have known any better. ;)
<rlavery> I have had the same experience heretofore with linux knowledge
<rlavery> I feel like I am picking up lisp late in my career
<J_Arcane> also I picked it up at a point in my career where I didn't have any habits I needed to unlearn in order to make sense of it
<J_Arcane> mostly I found it refreshing, because I am a lazy person by nature, and being able to do in one (map ...) what would've taken me a ten-line for loop in Python was more than enough for me to be like "well, why would I ever do anything else again?"
<rlavery> I semi identify with that. Typed Racket was very very brainbending in terms of trying to get everything to type check
<J_Arcane> point-ffree style blew my mind when I first tried haskell, but I eventually had to write my own monads to get any sense of how they work
<rlavery> I feel like Ruby implements enough syntax sugar and functional concepts that it's *almost* a lisp
<rlavery> but I am finally loving parens
<J_Arcane> and now I'm on the job dealing with like ... type-level operators and generic-derived monad transformers and all without any IDE tooling whatsoever so that's been ... fun.
<rlavery> monads I am still trying to wrap my head around entirely. i have read the wikipedia page, watched videos, I could probably recite something relatively correct about them
<rlavery> I have never been a fan of IDE tooling tbh
<J_Arcane> no type hints, no tooltips, no autocomplete, no click-to-definition ... zilch. Just an editor, grep, and some syntax lighting
<rlavery> that's my day-to-day haha
<rlavery> just without the monads
<J_Arcane> it's honestly kind of awful for Haskell, because I don't know what the hell I'm doing half the time, and now I've got no guide rails
<J_Arcane> all because my predecessor decided Stack was a conspiracy ...
<rlavery> you say 'just an editor' but I have built my career on vim haha. regexes and parenmatching can go a long way
<J_Arcane> well, yeah, I have autopairs and all that of course. I'm not a complete animal. ;)
<rlavery> I haven't gotten good enough with emacs yet to rave about orgmode or paredit
<rlavery> but i understand they are life-changing
<J_Arcane> paredit is ... eh.
<J_Arcane> the real magic is parinfer. ;)
<rlavery> will keep in mind if I ever decide it's time to ditch vim for evilmode
<J_Arcane> I thiiiink there might be a Vim mode for it too
<rlavery> ? is evilmode not vim mode?
<J_Arcane> no as in a plugin for Vim. I'm mixing my editor terms. XD
<rlavery> ohhhhh
<rlavery> I see!
<J_Arcane> looks like there's several
<rlavery> hmmm. looks useful, but I think it clash pretty hard with my existing muscle memory
<rlavery> I'm not sure yet though. it's brand new days for me with lisp. it's like i'm a brand new programmer all over again.
<J_Arcane> yeah. it's probably good to get the hang of manual syntax for a while until you use something like parinfer
<J_Arcane> once autopairs start feeling not enough, then have a look
<rlavery> I wonder if there's a way to get drracket's ctrl-i autoindent..
<J_Arcane> oh yes, and what's even madder, is you also get the *reverse*
<J_Arcane> parinfer has two modes: indent mode, and parens mode.
bartbes has quit [Quit: WeeChat 2.3]
<J_Arcane> In parens mode, you make parens, and it infers the correct indentation from the structure of them
bartbes has joined #racket
<J_Arcane> In indent mode, you write code, and it infers the position of closing parens based on the way you've indented it. :D
<rlavery> oooo.
<rlavery> ok yeah maybe then.
<rlavery> just caught up and read that part. i've kept my vim pretty plugin-free-- when I want a behavior I usually try to figure out how to get it without plugins. but this looks like a probable exception
<rlavery> https://github.com/bhurlow/vim-parinfer "dd - deletes line and balances parenthesis" GG
<J_Arcane> yeah. I tried to learn paredit when I still did emacs, but I never liked having to remember all those keystrokes.
<J_Arcane> parinfer is nice because it mostly just does what I want with only the basic tools, no special shortcuts to remember.
<rlavery> I don't mind memorizing a suite of composable shortcuts if they'll definitely help me get things done faster, but there's a cost/benefit in there. exempli gratia: https://xkcd.com/1205/
<J_Arcane> I have memory issues so it's pretty much hopeless for me.
<rlavery> bonus points for things that follow the principle of least surprise.
<J_Arcane> and codeswitching drives me nuts
<rlavery> or otherwise follow some well-known convention.
<J_Arcane> part of why I ditched emacs is I couldn't stand dealing with one app having totally different shortcuts and commands than every other standard CUA app
<rlavery> except readline ;)
<rlavery> which has a vim mode too lol.
ubLIX has joined #racket
<rlavery> I like emacs' C-e, C-a, M-f, M-b, C-k, C-y for e.g. bash and other readline-like inputs. I prefer vim's movement bindings in a curses context.
<soegaard> J_Arcane: What the space limitations on Glitch?
<J_Arcane> soegaard: 200mb
<soegaard> It's cool to have that kind of example ready for tutorials.
<soegaard> Do you know how close you are to the limit?
<J_Arcane> once I got the package right, I'm at only 77mb out of 200mb, and that's partly because I couldn't be bothered to delete the installer script.
<soegaard> Plenty of room then!
Nomenclatura has joined #racket
<J_Arcane> yeah.
<J_Arcane> and notibly, they have an asset-hosting feature that doesn't count against the storage space
<soegaard> What't their business plan?
<Nomenclatura> notoriously
<J_Arcane> so for images/media you can stick those there, it's sort of like an S3 bucket
<J_Arcane> soegaard: they have a commercial subscription version, Glitch for Teams.
<soegaard> Ok.
<J_Arcane> expands on the collab tools, removes the limits, etc. The Glitch site itself is at least partially developed in Glitch
<soegaard> Same idea as Slack then.
<soegaard> Must be difficult to compete with Github (although they don't have a hosting option - yet).
pie___ has quit [Quit: Leaving]
pie___ has joined #racket
codebam has joined #racket
<J_Arcane> soegaard: given the history and the leadership (this is a Fog Creek project), I get the sense they're not aiming to be a massive corporate player so much as make enough to fund the consumer facing side
<J_Arcane> the real-time collaboration stuff does seem pretty cool though, if you're into pair programming and the like.
sagax has quit [Ping timeout: 240 seconds]
widp_ has quit [Ping timeout: 246 seconds]
ym555 has joined #racket
widp_ has joined #racket
torbo has joined #racket
casaca has joined #racket
<lavaflow> if I break a thread, then drop any reference to it, that thread should be GC'd right?
<soegaard> lavaflow: I think sending a "break" is different from terminating the thread.
<lavaflow> if the break is unhandled and breaks are enabled, does the thread terminate?
<lavaflow> as I understand it, breaks are different from killing a thread insofar as you can disable breaks, and then when you re-enable breaks the thread will then break
<lavaflow> but it's not clear to me what happens to a thread after it breaks
<soegaard> Let's try it.
<soegaard> Looks litke it:
<soegaard> (define t (thread (λ () (let loop () (loop)))))
<soegaard> (thread-dead? t)
<soegaard> (break-thread t)
<soegaard> (sleep 1)
<soegaard> (thread-dead? t)
<soegaard> Prints:
<soegaard> #f
<soegaard> user break
<soegaard> #t
ZombieChicken has joined #racket
<lavaflow> awesome
soegaard has quit [Quit: soegaard]
libertyprime has joined #racket
<rlavery> J_Arcane Heresy is really fascinating reading. https://docs.racket-lang.org/heresy/monad-do.html got me closer than I've ever been to understanding monads!
<J_Arcane> Thanks. :D
<J_Arcane> that's basically what I built it for. XD
<rlavery> I think I gotta read up on syntax objects, because to me right now "[_ e ...]" : Monads :: "tlaol" : SCP-1425
<J_Arcane> rlavery: I find it helpful to think of macroset as a sort of pattern matching syntax
<J_Arcane> The first expression matches what an invocation might look like, the second matches what the expansion of that will look like
<J_Arcane> (also, heresy's `def macroset` is just a shortcut for `syntax-rules`, so it might be helpful to look at that)
ym555 has quit [Ping timeout: 255 seconds]
ym555 has joined #racket