--- Log opened Wed May 06 00:00:57 2020 |
00:31 | < Alek> | https://www.reddit.com/r/HFY/comments/gd0l9x/human_code/fpevkwi?utm_source=share&utm_medium=web2x |
01:07 | <@celticminstrel> | Why do they even need semicolons if they're not gonna be used for anything!? Just define the grammar without them? |
01:10 | <@celticminstrel> | The other language I know of with something like semicolon insertion (besides Go, Python, and JS which were already brought up) is Lua. |
01:13 | <&McMartin> | I would consider Python a different case; one in which newlines are treated as tokens in their own right most of the time. |
01:13 | <&McMartin> | That said |
01:15 | <&McMartin> | Early in Golang's lifecycle it had a kind of manifesto that went with it |
01:16 | <&McMartin> | Basically ranting about how modern languages are more like proving a theorem than having a conversation with a computer |
01:16 | <&McMartin> | This attitude is one I consider dangerous, which is one reason I am fond of Rust~ |
01:35 | <@celticminstrel> | It's dangerous to think of languages as proving a theorem? Or it's dangerous to think of them like having a conversation with a computer? |
01:35 | <&McMartin> | The latter. |
01:36 | <&McMartin> | Basically it says "I want the syntax to be super sloppy and for the language to do what *I* want" |
01:36 | <@celticminstrel> | Like AppleScript huh. |
01:36 | <&McMartin> | And lo, your language is underspecified, awkward, and often has surprising side effects |
01:36 | <@celticminstrel> | Mind you, Inform7 is also kinda sloppy too, syntax-wise... |
01:36 | <&McMartin> | I was about to say Inform 7 is impressively rigid on a lot of this |
01:36 | <&McMartin> | It's rare that there's multiple ways to express the same computation. |
01:36 | <&McMartin> | I can only think of one offhand |
01:37 | <&McMartin> | Certain things can be assigned with "now X is Y" and "change X to Y" |
01:37 | | Kindamoody is now known as Kindamoody[zZz] |
01:37 | <&McMartin> | But no, the specific things that Pike was complaining about were things like having to declare the types of variables |
01:37 | <&McMartin> | Or express relationships between types. |
01:37 | <~Vornicus> | |
01:38 | <&McMartin> | I mean, Python |
01:38 | <@celticminstrel> | I guess technically there's no reason why whitespace needs to be the One True Separator like is the case in every language that I can think of besides Inform7, so maybe it just manages to look sloppy without actually being it. |
01:38 | <~Vornicus> | what did pike do before goland anyway wasn't he famous for something |
01:38 | <&McMartin> | He's one of the group of people who pioneered the early Unix world |
01:39 | <&McMartin> | He also wrote the (excellent) "The Practice of Programming" with Kernighan |
01:43 | <&McMartin> | Anyway, yeah. THe language has grown beyond its initial origins of "annoyance at Python's GIL and C++'s Everything" |
01:43 | <&McMartin> | But it's noticably clunky in ways that are different in detail from Perl but very similar in how they grate on me. |
02:01 | <@celticminstrel> | What's GIL BTW? |
02:02 | <&McMartin> | Global Interpreter Lock |
02:02 | <@celticminstrel> | Ahhh. |
02:02 | <&McMartin> | aka Why You Shouldn't Write Servers In Python. |
02:03 | <@celticminstrel> | Is that actually required by the language specification? |
02:03 | <@celticminstrel> | The GIL I mean. |
02:03 | <&McMartin> | I believe the semantics require it, yes. |
02:03 | <@celticminstrel> | Huh… |
02:03 | <&McMartin> | All alternatives I'm aware of end up modifying the language and getting a different name, of which Twisted Python is the one that comes most immediately to mind. |
02:03 | <@celticminstrel> | Incidentally, "servers in Python" is not the same as WSGI right? |
02:04 | <&McMartin> | Probably not, if only because you can spin up a bunch of python processes to do that work at worst, I'd guess. |
02:05 | <&McMartin> | It's when you run the server itself, you basically struggle to scale simultaneous connections past a certain point because the internal interpreter state keeps locking you down. |
02:07 | <&McMartin> | Hmm. Apparently Jython and IronPython do not have GILs, so it may be an implementation detail of CPython after all. |
02:08 | <@celticminstrel> | Do either of those support Python 3 yet? |
02:08 | <&McMartin> | No idea |
02:08 | <@celticminstrel> | Last I heard Jython was stuck at 2, tho that was admittedly a few years ago. |
02:08 | <&McMartin> | I haven't had to use Python in production environments in a long time... and the last time I did, it was to implement a replacement service in Golang. -_- |
02:08 | <@celticminstrel> | XD |
02:10 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
04:41 | | macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
04:41 | | mode/#code [+o macdjord|slep] by ChanServ |
04:41 | | Degi [Degi@Nightstar-2fh91k.dyn.telefonica.de] has quit [Operation timed out] |
04:43 | | mac [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
04:45 | | Degi [Degi@Nightstar-o9i4cg.dyn.telefonica.de] has joined #code |
05:16 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Connection closed] |
05:17 | | celticminstrel [celticminst@Nightstar-nuu42v.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
05:17 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
05:25 | | mac [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code |
05:25 | | mode/#code [+o mac] by ChanServ |
05:27 | | catalyst [catalyst@Nightstar-hfig8q.dab.02.net] has joined #code |
05:28 | | catalyst_ [catalyst@Nightstar-e7lr46.dab.02.net] has quit [Ping timeout: 121 seconds] |
05:28 | | macdjord|slep [macdjord@Nightstar-rslo4b.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
05:39 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
05:43 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
05:57 | | * McMartin tracks down a spectacularly ugly bug that turns out to be because config settings are being reinitialized in the wrong order. >_< |
05:57 | <&McMartin> | Pretty sure the real fix here is to make sure that settings are orthogonal instead of mucking with the order of operations. |
06:08 | | JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code |
06:08 | | JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [NickServ (RECOVER command used by JustLurk)] |
06:08 | | mode/#code [+o JustLurk] by ChanServ |
06:08 | | JustLurk is now known as JustBob |
08:06 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed] |
08:06 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code |
08:06 | | mode/#code [+ao VirusJTG VirusJTG] by ChanServ |
08:47 | | bluefoxx [fuzzylombax@Nightstar-gmbj85.vs.shawcable.net] has quit [Ping timeout: 121 seconds] |
08:50 | | bluefoxx [fuzzylombax@Nightstar-gmbj85.vs.shawcable.net] has joined #code |
08:59 | | Kindamoody[zZz] is now known as Kindamoody |
09:19 | | catalyst_ [catalyst@Nightstar-v6lb30.cable.virginm.net] has joined #code |
09:23 | | catalyst [catalyst@Nightstar-hfig8q.dab.02.net] has quit [Ping timeout: 121 seconds] |
09:31 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
09:31 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
10:45 | | Pink` [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
10:48 | | Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
11:41 | | catalyst_ [catalyst@Nightstar-v6lb30.cable.virginm.net] has quit [Ping timeout: 121 seconds] |
11:50 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has joined #code |
12:46 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has quit [Connection closed] |
12:47 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has joined #code |
13:19 | | celticminstrel [celticminst@Nightstar-nuu42v.dsl.bell.ca] has joined #code |
13:19 | | mode/#code [+o celticminstrel] by ChanServ |
13:21 | <@sshine> | I'm modelling some infrastructure for a stock exchange so that, at a later point, it can be used to handle a particular protocol. |
13:22 | <@sshine> | so far I've got an InstrumentsRepository which basically has a GetInstrumentByX(X) method. my task is to populate this repository with values from a REST HTTP API. |
13:26 | <@sshine> | this InstrumentsRepository has an event-driven interface with an exposed ISubject<InstrumentSyncEvent>, where ISubject is a C# thing that says "this thing is both a IObserver and an IObservable", so it's both a stream of events that can be subscribed to, and a listener of other events. |
13:28 | <@sshine> | an InstrumentSyncEvent is just (added, current, removed), indicating if any instruments were added/removed since... some point in time, and regardless, which instruments are available now. |
13:31 | <@sshine> | I want to somehow be able to say that an InstrumentsRepository subscribes to an HTTP API via some service, and this service should poll the HTTP API and send signals back to its subscribers that indicate the latest state of, e.g., what instruments are available. |
13:35 | <@sshine> | (also, this is mostly a monologue for now.) |
14:20 | <@sshine> | (also, back to drawing.) |
15:22 | | catalyst_ [catalyst@Nightstar-n20snd.dab.02.net] has joined #code |
15:25 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has quit [Ping timeout: 121 seconds] |
15:36 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has joined #code |
15:39 | | catalyst_ [catalyst@Nightstar-n20snd.dab.02.net] has quit [Connection reset by peer] |
16:03 | | Kindamoody is now known as Kindamoody|afk |
16:20 | <@sshine> | okay, so I've got these two things: InstrumentsRepository, and InstrumentsHttpApi. the repository is agnostic towards its feeds, and the HttpApi is just one way to feed the repository instruments via polling a REST API. |
16:22 | <@sshine> | so thinking reactively about this (C#'s IObserver, IObservable, ISubject, etc.), it sounds like InstrumentsRepository should be subscribing to HttpApi. |
16:36 | <@sshine> | but I don't know, couldn't the act of subscription rest in multiple places? this is where my experience with inversion of control is a bit lacking. |
17:17 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:48 | | Pink` [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
17:49 | | Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code |
19:23 | <&ToxicFrog> | For fuck's sake, does no-one have a frexp() implementation that doesn't rely on type-punning? |
19:23 | | catalyst [catalyst@Nightstar-v6lb30.cable.virginm.net] has quit [The TLS connection was non-properly terminated.] |
19:30 | <~Vornicus> | it seems like the alternative would be annoying. |
19:48 | <~Vornicus> | Seems way less terrible to do something like turn it into a bunch of bytes and do bit shoving than to try to do frexp using arithmetic |
20:01 | < Emmy> | type punning? |
20:03 | <~Vornicus> | type punning: reading the data from a bit of memory using a data type other than the one originally intended by the program |
20:05 | <~Vornicus> | for instance, if you put sqrt(2) in a float and then read it out as an int, giving -217,795,265 |
20:32 | < Emmy> | dark magic! |
20:47 | | Kindamoody|afk is now known as Kindamoody |
20:47 | <~Vornicus> | You can use type punning for frexp because the segments you extract are contained as sequences of bits in the float, so once you have it as an int ou can use bit shifts and masking to get what you need. |
22:02 | <&ToxicFrog> | Vornicus: yeah, but the problem is that I'm trying to do a pure-lua implementation of it, and it would be nice to have another impl to reference. |
22:12 | <~Vornicus> | looking at I think binary search to pull the exponent out |
22:23 | <~Vornicus> | The difficulty is that type punning is absurdly effective precisely because floating point is literally a bitfield structure. |
22:35 | <&ToxicFrog> | Yes. |
22:35 | <&ToxicFrog> | And everyone who doesn't have that just calls into C anyways~ |
22:40 | <&ToxicFrog> | SUPER GROSS IDEA: buf = ("return %a"):format(n):dump(), then use the bitfield unpacking functions on buf |
22:40 | <&ToxicFrog> | There is an existing pure-lua implementation kicking around but it doesn't work |
22:41 | <&ToxicFrog> | Specifically it defines `e = floor(log(abs(x)) / log2 + 1.0)` and then `m = x/2^e`, but for values very close to infinity 2^e is inf and the wheels come off. |
22:42 | <~Vornicus> | that's literal type punning |
22:43 | <&ToxicFrog> | I mean, yes |
22:43 | <&ToxicFrog> | But it's type punning in a language that doesn't have it by generating bytecode at runtime and then inspecting that |
22:44 | <&ToxicFrog> | Oh, wait, I missed a loadstring() call in there |
22:44 | <&ToxicFrog> | string.dump(loadstring(string.format("return %a", n))) |
22:46 | <&ToxicFrog> | Problem there is that the bytecode format is version and architecture specific :/ |
22:48 | | Kindamoody is now known as Kindamoody[zZz] |
23:03 | <&ToxicFrog> | Ahahahaha the builtin frexp() violates its own documentation |
23:04 | <&ToxicFrog> | If you give it 1.7976931348623157081e+308 it reutrns 1,1024 but the docs say it returns values in the range [0.5,1) |
23:06 | <~Vornicus> | that's NUM_HUGE or whatever it's called right |
23:24 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
23:53 | <&ToxicFrog> | math.huge, but no, math.huge is infinity -- that's 1 bit less than infinity, the largest representable double. |
--- Log closed Thu May 07 00:00:59 2020 |