Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 599 600 601 602 603 604 605 606 607 608 609 .. 5022
502,152 events total
2020-10-12 20:34:26 knupfer joins (~Thunderbi@200116b82c8e3e00808f1416e66f4b20.dip.versatel-1u1.de)
2020-10-12 20:34:32 <davean> HTTP has semantics, those semantics are controlled by headers often, they are not the client's concern and they don't represent anything on the recieve handling
2020-10-12 20:34:55 <davean> They are decisions made about the request by the hander, based on the request, and none something the client observes
2020-10-12 20:35:20 <davean> Which makes getting HTTP-correct requests encoded in Servant *very* difficult
2020-10-12 20:35:47 <untseac> maerwald, because declarative seems like a good way to make games. imperative is gives too many changes to make mistakes. if everything is functional than there's a good change that it's easy to maintain. but as everybody else I don't know a good way to do it.
2020-10-12 20:35:56 × knupfer quits (~Thunderbi@200116b82c8e3e00808f1416e66f4b20.dip.versatel-1u1.de) (Client Quit)
2020-10-12 20:36:04 knupfer joins (~Thunderbi@200116b82c8e3e00d959907963760a34.dip.versatel-1u1.de)
2020-10-12 20:36:06 <maerwald> I think that's a fallacy, but we'd have to see
2020-10-12 20:36:07 <dminuoso> davean: It depends on your problem domain I guess. In mine, I can get away without any caching.
2020-10-12 20:36:27 hackage yamlparse-applicative 0.1.0.2 - Declaritive configuration parsing with free docs https://hackage.haskell.org/package/yamlparse-applicative-0.1.0.2 (Norfair)
2020-10-12 20:36:31 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 260 seconds)
2020-10-12 20:36:35 <davean> dminuoso: Right - if you're using HTTP as a dumb transport, but it isn't. Servant's design can't really handle that sanely.
2020-10-12 20:36:42 <untseac> perhaps maerwald but no point in not trying
2020-10-12 20:36:52 <dminuoso> davean: Im well aware.
2020-10-12 20:36:53 <davean> dminuoso: theres a bunch of other semantic HTTP headers
2020-10-12 20:37:08 <maerwald> I'd rather use rust for a game engine
2020-10-12 20:37:16 × knupfer quits (~Thunderbi@200116b82c8e3e00d959907963760a34.dip.versatel-1u1.de) (Client Quit)
2020-10-12 20:37:21 knupfer1 joins (~Thunderbi@200116b82c8e3e0065c803bf9b6001f6.dip.versatel-1u1.de)
2020-10-12 20:37:27 <maerwald> haskell seems more like "because I want to", not because it makes terrible sense for an engine
2020-10-12 20:37:31 × knupfer1 quits (~Thunderbi@200116b82c8e3e0065c803bf9b6001f6.dip.versatel-1u1.de) (Client Quit)
2020-10-12 20:37:39 knupfer joins (~Thunderbi@200116b82c8e3e0045b1d251e43f77de.dip.versatel-1u1.de)
2020-10-12 20:37:40 <untseac> so far it seems like it
2020-10-12 20:37:58 <davean> maerwald: As an ex-cared-about-game-dev I can think of a few ways in which Haskell is good, or more really functional.
2020-10-12 20:38:05 <davean> But its hard to get the other stuff right
2020-10-12 20:38:17 <dminuoso> davean: If you grok HTTP well, and understand programming well enough, it's quite insane how people stuff data into an unstructured and inefficient protocol like JSON, and then stuff it into a highly semantic, inefficient and human readable protocol like HTTP...
2020-10-12 20:38:23 <maerwald> engines care about performance and predictable memory consumption
2020-10-12 20:38:27 <dminuoso> And I must admit, we do it as well
2020-10-12 20:38:35 <untseac> real time is hard in haskell. I think anyone figured that out with some time.
2020-10-12 20:38:40 <dminuoso> The main reason is just, it's fast to get communication between two agents with servant.
2020-10-12 20:38:45 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2020-10-12 20:39:06 <dminuoso> (And in the above, my main beef isnt even HTTP, it's how JSON is an awful serialization format)
2020-10-12 20:39:40 <maerwald> I could much rather imagine a DSL-style API around a C engine. But why do the low-level work in Haskell
2020-10-12 20:39:43 <dminuoso> What happened to the art of writing a simple wire protocol ontop of TCP..
2020-10-12 20:40:06 <untseac> that could be an option maerwald
2020-10-12 20:40:16 <cohn> koz_: yep, sqlite-simple installed without a hitch
2020-10-12 20:40:19 <cohn> thanks!
2020-10-12 20:40:20 × knupfer quits (~Thunderbi@200116b82c8e3e0045b1d251e43f77de.dip.versatel-1u1.de) (Client Quit)
2020-10-12 20:40:23 <koz_> cohn: No worries.
2020-10-12 20:40:25 <untseac> but there are many games in Java and it's far from the fastest or with predictable memory
2020-10-12 20:40:29 knupfer joins (~Thunderbi@200116b82c8e3e00b0c84bfaac702eb0.dip.versatel-1u1.de)
2020-10-12 20:40:35 <davean> maerwald: its easier to talk about the data structure changes, which are pretty critical for performance, and the functional style avoids a whole bunch of (very common in games) errors around pipelining.
2020-10-12 20:40:36 <untseac> in fact it's really bad at predictable memory
2020-10-12 20:40:57 laserpants joins (c59d0021@197.157.0.33)
2020-10-12 20:42:08 <untseac> the main problem from what I see in game dev is that everyone thinks imperative by default so there's a lack of interest. Even languages other than C++ took a very long time to be popular in video game development.
2020-10-12 20:42:13 <untseac> let alone haskell
2020-10-12 20:42:35 <untseac> only now C# and python are popular choices
2020-10-12 20:42:47 <davean> C++ took a while too
2020-10-12 20:42:58 <davean> C++ use to be a lot harder to write efficiently than it is now
2020-10-12 20:43:01 <untseac> yeah it was C before that and assembly before
2020-10-12 20:43:31 <davean> I was mostly active in the C-like-C++-but-with-custom-assembly-for-every-CPU era
2020-10-12 20:43:36 <untseac> game development cares more about what exists, not what can be done. after all it's a business model to sell fast.
2020-10-12 20:43:37 JordiGH joins (jordi@octave/developer/JordiGH)
2020-10-12 20:43:47 <dminuoso> davean: At any rate, I fully understand your beef with servant if managing headers is something you actually have to do. I just noticed that myself and some others don't have that need.
2020-10-12 20:43:50 <JordiGH> What's the syntax to define several where variables on the same line?
2020-10-12 20:44:00 proofofme joins (~proofofme@184-96-74-65.hlrn.qwest.net)
2020-10-12 20:44:03 motte joins (~weechat@unaffiliated/motte)
2020-10-12 20:44:14 <JordiGH> (Haskell's the whitespace thing is an optional the whitespace thing, right?)
2020-10-12 20:44:21 <davean> dminuoso: of course. I just wish they would have a sane approach to HTTP given its supposed to be for HTTP ;)
2020-10-12 20:44:32 <ski> JordiGH : `... where x = 2; f y = x + y'
2020-10-12 20:44:32 <untseac> JordiGH, put another variable bellow
2020-10-12 20:44:48 <untseac> or that
2020-10-12 20:44:54 <JordiGH> ski: k thanks, let me see.
2020-10-12 20:44:57 <laserpants> Is anyone using hdevtools and Syntastic with vim/neovim? I reinstalled my machine and probably missed some step because the checks are not working. The background service is running and hdevtools is in the PATH. Typing :SyntasticInfo in vim also says that it is active.
2020-10-12 20:44:57 <JordiGH> untseac: Below?
2020-10-12 20:45:11 <ski> they mean, "not on the same line"
2020-10-12 20:45:27 <untseac> y
2020-10-12 20:46:29 <JordiGH> Alright, this works, let me see if I can figure out how to do this... I want to write a four-point recurrence... two-point is pretty easy with zipWith and tail
2020-10-12 20:47:05 <dminuoso> davean: To partially quote monochrom: "Programming is a dialectic class struggle between the author and the user.". On one hand you want to get easy access to headers, and on the other side of the table there's the desire to consider all parameters in a request to be parameters that belong in the declarative description of the API.
2020-10-12 20:47:25 <dminuoso> It's a trade off either way
2020-10-12 20:47:37 × knupfer quits (~Thunderbi@200116b82c8e3e00b0c84bfaac702eb0.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-10-12 20:47:44 × LKoen quits (~LKoen@81.255.219.130) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”)
2020-10-12 20:48:23 <davean> dminuoso: Eh, thats true for some HTTP headers, but I don't think that can be considered true for the semantic ones because they should not be observable on either end
2020-10-12 20:48:36 <davean> They are how the infastructure handles the transport
2020-10-12 20:50:09 <ski> JordiGH : `as = a0 : a1 : a2 : a3 : [..an0..an1..an2..an3.. | an0:an1:an2:an3:_ <- tails as]' ?
2020-10-12 20:50:15 × proofofme quits (~proofofme@184-96-74-65.hlrn.qwest.net) (Remote host closed the connection)
2020-10-12 20:50:20 <JordiGH> Okay, yeah, I don't have enough for this. I want to compute fib_2*fib_4 - fib_1*fib_3 where fib_1, fib_2, fib_3, and fib_4 are four consecutive fibonacci numbers.
2020-10-12 20:51:06 <dminuoso> davean: Id say a web server is not separated from the semantics, it's part of it. For instance, it's your job to produce the correct semantic HTTP status codes.
2020-10-12 20:51:08 <JordiGH> ski: Ohhhh, wait, I think I get it.
2020-10-12 20:51:28 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
2020-10-12 20:51:31 <JordiGH> And I also realise I didn't mean a recurrence. :-/
2020-10-12 20:51:33 <davean> dminuoso: But its not even the server - its things like the caches inbetween, etc
2020-10-12 20:51:46 <davean> Also, status codes are header-invariant
2020-10-12 20:51:54 <JordiGH> I meant... taking four elements at a time from the fibonacci sequence.
2020-10-12 20:52:04 <ski> > let fibs = 0 : 1 : [fib_n0 + fib_n1 | fib_n0:fib_n1:_ <- tails fibs]om [fib_1*fib_3 - fib_0*fib_2 | fib_0:fib_1:fib_2:fib_3:_ <- fibs]
2020-10-12 20:52:07 <lambdabot> <no location info>: error:
2020-10-12 20:52:07 <lambdabot> not an expression: ‘let fibs = 0 : 1 : [fib_n0 + fib_n1 | fib_n0:fib_n1:...
2020-10-12 20:52:14 <ski> > let fibs = 0 : 1 : [fib_n0 + fib_n1 | fib_n0:fib_n1:_ <- tails fibs] in [fib_1*fib_3 - fib_0*fib_2 | fib_0:fib_1:fib_2:fib_3:_ <- fibs]
2020-10-12 20:52:17 <lambdabot> error:
2020-10-12 20:52:17 <lambdabot> • No instance for (Num [Integer])
2020-10-12 20:52:17 <lambdabot> arising from a use of ‘e_101010113020123’
2020-10-12 20:52:30 <JordiGH> A use of what??
2020-10-12 20:52:53 <ski> er, sorry
2020-10-12 20:53:07 <ski> > let fibs = 0 : 1 : [fib_n0 + fib_n1 | fib_n0:fib_n1:_ <- tails fibs] in [fib_1*fib_3 - fib_0*fib_2 | fib_0:fib_1:fib_2:fib_3:_ <- tails fibs]
2020-10-12 20:53:09 <lambdabot> [2,1,7,14,41,103,274,713,1871,4894,12817,33551,87842,229969,602071,1576238,4...
2020-10-12 20:53:11 <ski> > let fibs = 0 : 1 : [fib_n0 + fib_n1 | fib_n0:fib_n1:_ <- tails fibs] in [fib_1*fib_3 - fib_0*fib_2 | [fib_0,fib_1,fib_2,fib_3] <- chunksOf 4 fibs]
2020-10-12 20:53:13 <lambdabot> [2,41,1871,87842,4126649,193864607,9107509826,427859097161,20100270056687,94...
2020-10-12 20:53:14 <JordiGH> The ghc error messages never make any sense to me, I've learned to ignore them.
2020-10-12 20:53:25 <ski> the latter is "four at a time". the former is "sliding window of four"
2020-10-12 20:53:51 <davean> dminuoso: specificly headers vary on the occuring path between the client and server
2020-10-12 20:54:02 <davean> So you can't know them without knowing the path

All times are in UTC.