code logs -> 2016 -> Fri, 02 Sep 2016< code.20160901.log - code.20160903.log >
--- Log opened Fri Sep 02 00:00:26 2016
00:31
<&Derakon>
https://twitter.com/FioraAeterna/status/768580419386085376/photo/1?ref_src=twsrc %5Etfw
00:35
<@gnolam>
>_<
00:36
<&Derakon>
NPM, the Node Package Manager, is a shrieking horror from the abyss.
00:36
<&Derakon>
Then again, so is much of modern Javascript development.
00:37
<@gnolam>
... it's javascript.
00:38
<&Derakon>
Javascript itself is not really an awful language.
00:38
<&Derakon>
I mean, it's not great but it's not awful.
00:38
<~Vornicus>
...also from that person's twitter feed: http://www.nytimes.com/2016/09/02/technology/when-im-mistakenly-put-on-an-email- chain-should-i-hit-reply-all-asking-to-be-removed.html?smprod=nytcore-ipad&smid= nytcore-ipad-share
00:38
<&Derakon>
It's all the things that are done with Javascript that make Javascript development so horrible.
00:38
<@gnolam>
No really, it is awful. Javascript and PHP are about equal in awfulness.
00:39
<&Derakon>
Got any examples of Javascript awfulness?
00:39
<~Vornicus>
month numbering
00:39
<&Derakon>
...let me rephrase.
00:39
<&Derakon>
Since you are putting it on par with PHP, do you have 10,000 examples of its awfulness~?
00:39
<@gnolam>
I assume you've seen the WAT talk?
00:39
<@gnolam>
... have you seen the Internet lately?
00:40
<&[R]>
Any largely profilic language is going to end up pushing out a ton of shit
00:40
<&Derakon>
The Internet is an "awful things done with a language" thing, not a "language is inherently awful" thing.
00:40
<&Derakon>
I mean, we should no more blame English for Donald Trump's campaign speeches.
00:42
<&Derakon>
Okay, I'd forgotten the Wat Talk's Javascript bit.
00:43
<&Derakon>
Implicit type conversions are a horror in all languages, though~
00:48
<@gnolam>
Not as horrible as in Javascript. AFAICT, JS follows The Principle of Most Astonishment.
00:51
<&[R]>
I'd argue the primary qualifier for a language being horrible is the difficulty in which it is to make good code.
00:51
<~Vornicus>
a lot of what you see in the js wat talk is actually the terp's weird method of showing arrays.
00:51
<&[R]>
Conversely the primary qualifier for a language being good is the difficulty in which it is to make bad code.
00:51
<~Vornicus>
which for some reason it just concatenates everything with no commas or anything
00:54
<&[R]>
IMO C's pretty on par with JS for weird edge-casey shit.
00:55
<@gnolam>
Oh God no.
00:55
<@gnolam>
C is perfectly logical, as long as you remember that it's a thin layer above assembly.
00:56
<@gnolam>
And as long as you're not doing advanced pointer fuckery, your edge cases will result in an error and not WTF IS GOING ON THIS IS NOT THE PROGRAM I WROTE
00:57
<&[R]>
Yet, that's the main reason would would write in C.
01:52
< ToxicFrog>
gnolam: I'm not a fan of JS or how people use it, but damn, putting it on the same tier as PHP dramatically undersells how bad PHP is.
01:53
< ToxicFrog>
(and yes, I've seen the WAT talk. You could come up with as much material for most languages. PHP you'd die of exhaustion before finishing the talk.)
03:09
<&McMartin>
Also, WAT has exactly one trick to it and it's "JS type coercion rules are dumb"
03:09
<&McMartin>
Also some wackiness for Ruby, which is bad but which he points is awesome
03:09
<&McMartin>
< Tyrannosaurus playing the drums in front of a nuclear explosion >
03:09
<&McMartin>
But if you actually do it then wat
03:09
<&McMartin>
< rubber duck twice the size of a major municipal bridge >
03:26 catadroid` is now known as catadroid
03:30
<&McMartin>
https://twitter.com/Toyapup/status/710100777822507008
03:40
<&McMartin>
Also, I can confirm that unlike PHP, JS is not fractally bad.
03:41
<&McMartin>
It is not only true but uncontroversial that one could subset Actual JS As It Is and get a very solid if somewhat alien language.
03:41
< catadroid>
Javascript *is* bad, though, largely because it was built in ten days and has suffered since
03:41
<&McMartin>
(Those of you who have not read https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ have a treat!)
03:42
< catadroid>
Basically consuming all of what's his face's content on a The Good Bits is worthwhile
03:42
< catadroid>
After that it becomes a rather fascinating language
03:42
<&McMartin>
Yes.
03:42
<&McMartin>
That guy is the designer of JS
03:42
< catadroid>
No
03:42
<&McMartin>
Becuase unlike PHP it actually had one~
03:42
<&McMartin>
No?
03:43
< catadroid>
Brandon Eich designed and built it
03:43
<&McMartin>
I seem to have a circuit crossed
03:43
<~Vornicus>
good bits guy designed json
03:43
<&McMartin>
... That's the circuit that's crossed, thank you
03:43
<&McMartin>
Anyway
03:43
<&McMartin>
He's right about which bits are good
03:43
< catadroid>
Douglas Crockford is the other guy
03:44
< catadroid>
Yeah, his analysis of that is well thought through
03:44
<&McMartin>
He's taken the Leprechaun Express to the dark side of Mars when it comes to figuring out which bits of the not-good are actually bad
03:44
< catadroid>
Also, javascript is basically an attempt to implement Scheme whilst not looking like Scheme
03:44
< catadroid>
In ten days
03:44
<&McMartin>
He is spectacularly enraged by the existence of reserved words
03:44
< catadroid>
Given that, I think Eich did quite a job
03:44
<&McMartin>
And thus, I must conclude, by distinct lexer/parser passes
03:45
<&McMartin>
Yeah
03:45
<&McMartin>
He nailed the semantics on functions, and half the ways you accomodate weaknesses in JS is by straightforward reapplication of the similar tricks you use to get around the simplicity of Scheme's core design.
03:46
<&McMartin>
To the extend that you will still get burned by them in JS, this is a thing that will also burn you in Scheme if you aren't careful and import Common LISP idioms into it
03:46
< catadroid>
(basically they said 'we need a scripting language', Eich said 'okay here's scheme' and they said 'fuck no it needs to look like Java what the fuck is this')
03:46
<&McMartin>
... and Common LISP gets to stand in for Python here much to the annoyance of both
03:46
< catadroid>
Common Lisp is frustratingly pragmatic
03:47
<&McMartin>
EcmaScript 6 actually fixes the issue Scheme avoids with rebinding-by-default but it's a bit subtle for my taste
03:48 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
03:49 * catadroid nods
03:50
< catadroid>
It has been enlightening to me to realise that neither Scheme nor common lisp are exactly pure in any sense
03:58
<~Vornicus>
I got so hung up on the "bad parts" that I've forgotten what the good parts are
03:59
<&McMartin>
Yeah. Lisp has roots not entirely unlike Algol (or, ultimately, Haskell), in that they were originally notations to be written by humans when writing papers
03:59
<&McMartin>
And then some wit went and actually implemented them.
03:59
<&McMartin>
In Lisp's case because McCarthy had written the Metacircular Evaluator
03:59
<&McMartin>
And his gradstudent was like "dude, I can *write that function in machine code* and then we can just *type in LISP programs*"
03:59
<&McMartin>
And then McCarthy was like "oh ho ho ho, the exuberance of youth, that is not how this works"
03:59
<&McMartin>
But it did
03:59
<&McMartin>
That grad student then went on to invent Spacewar
04:02
<&McMartin>
Vorn: JS's three finest features are (a) an object-literal notation syntax that is, if not The Best, one you should really be always deciding explicitly doesn't fit your needs; (b) function literals and lexical scoping correct to the most exacting standards[*]; (c) due to (a) and (b) permitting efficient-enough-for-scripting-languages in-place implementations of a bunch of things normally thought of as
04:02
<&McMartin>
language features, without having to extend the language (namespaces, modules, private ivars)
04:02
<&McMartin>
[*] There are still lots of gotchas surrounding the use of nested functions, but those gotchas involve their interaction with JS's wildly broken variable scoping rules and the inherent danger of capturing values by reference in a series of closures
04:03
<&McMartin>
s/values by reference/mutable values by reference/
04:04
< catadroid>
Mutation is the mind killer
04:04
<&McMartin>
Right, but you don't get to blame JavaScript for mutation.
04:04
<~Vornicus>
<3 frozenset
04:05
< catadroid>
I'm not :)
04:06
< catadroid>
Incidentally, lack of mutation is also the mind killer
04:06
<&McMartin>
Yeah, this is "one of the standard 'look how awful JS is' things involves a reasonable-looking but wrong use of function literals and loop variables"
04:06
<&McMartin>
This is teh case that was fixed - a bit oversubtly for my taste - in Ecma6
04:06
<&McMartin>
But if you write it out with set!s, that misbehavior exists in Scheme
04:07
<&McMartin>
Which means that when excoriating JS/Ecma5, the furthest I'm willing to go there is "JS makes it too easy to do the wrong thing here"
04:07
<~Vornicus>
ecma6 makes me happy.
04:07
<&McMartin>
Making the misbehavior happen in Scheme requires code that is *obviously* wonky-looking
04:08
< catadroid>
All code is wonky looking until you've developed biases
04:08
< catadroid>
...I'm not being helpful
04:09
<~Vornicus>
finally got to use things in it a few weeks back, it was so nice.
04:09
<&McMartin>
I'm just going to be over here <3-ing named let
04:09 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
04:09 mode/#code [+o himi] by ChanServ
04:09
< catadroid>
:)
04:09
<&McMartin>
Vornicus: Yeah, the oversubtle thing that I'm referring to here is that for (var i = ...)... is incorrect, and for (let i = ...) is correct
04:09
< catadroid>
I really like clojure and Scheme
04:09
<&McMartin>
For the "weird case"
04:10
< catadroid>
Common lisp feels far too much like the s-exp version of C++'s approach
04:10
<&McMartin>
Heh
04:10
<&McMartin>
I did a bit of work in it back in the day, just to poke at what compilers shipped with my Linux repos
04:10
<&McMartin>
My two takeaways were:
04:10
<&McMartin>
(1) Man, this feels like working in a constrained Python
04:10
<&McMartin>
(2) HOLY SHIT, THIS CODE IS FAST
04:11
<&McMartin>
I think only hand-tuned C ended up beating it
04:11
< catadroid>
Fast?
04:11
<&McMartin>
I didn't try to tune the C++
04:11
<&McMartin>
The test program I used for all this was a Klotski solver
04:11
<&McMartin>
A relatively naive one
04:11
< catadroid>
No one tunes the C++ and retains their sanity
04:12
<~Vornicus>
she says, having spent all day at work tuning C++
04:12
<&McMartin>
The ecl compiler and and the hand-tuned C someone else wrote with their super-optimized set libraries and that leaked all the memory were the only two implementations on that system that ran in sub-second times
04:12 catadroid` [catadroid@Nightstar-8jlt7o.dab.02.net] has joined #code
04:12
< catadroid`>
This is something I feel I can talk with complete authority on
04:12
<&McMartin>
Look, we're talking about computer stuff with an Elder God here
04:12
< catadroid`>
?
04:12
<&McMartin>
SAN is overrated
04:12
<&Derakon>
I sometimes feel like I ought to try more programming languages.
04:12
< catadroid`>
SAN?
04:13
<&McMartin>
Vorn is named for the surfer Cthulhu from Freakazoid, IIRC
04:13
<&McMartin>
SAN is the Sanity stat from Call of Cthulhu
04:13
<&Derakon>
The problem being that I rarely have programming stuff I want to do outside of work, these days, and you don't experiment with languages for Real Work.
04:13
< catadroid`>
Ah right
04:13
<~Vornicus>
common lisp felt to me like -- and this was a long time ago, before I understood anything about it -- how do I put it. There seemed to be this era of language design where if you wanted the language to be able to do something, you had to add it in to the core.
04:13
< Pink`>
https://twitter.com/joewintergreen/status/771286159682998273/photo/1?ref_src=tws rc^tfw
04:13
< catadroid`>
Derakon: you don't? Shit
04:13
<&Derakon>
Cat: I have far too many hobbies.
04:14
<&McMartin>
Derakon builds physical objects
04:14
<~Vornicus>
Including entire buildings!
04:14
<&Derakon>
In addition to carpentry, I have a dog, I do Let's Plays, I read, I play water polo and videogames.
04:14
< catadroid`>
I meant that in response to the production code comment :)
04:14
<&Derakon>
Oh, right.
04:15
< catadroid`>
Otherwise I would just be a dick
04:15
<&Derakon>
Yeah, that kind of attitude is why at my previous job we had a gigantic blob of code in a critical component that was written in amateurish Clojure.
04:15
<&Derakon>
So nobody really wanted to mess with it, which really hampered our ability to update the code.
04:15 catadroid [catadroid@Nightstar-23iq15.dab.02.net] has quit [Ping timeout: 121 seconds]
04:16
< catadroid`>
Sadly we have some fairly well used stuff written in Ruby
04:16
<&Derakon>
(The rest of the program is Java and C++)
04:16
< catadroid`>
Even though I dislike python, since it's the language we decided to use I'm still going to use that
04:17
< catadroid`>
C++, Lua or Python, or god help you, Jam
04:17 catadroid` is now known as catadroid
04:17
<&Derakon>
I don't think I've heard of Jam.
04:17
<&McMartin>
It's one of the infinitude of Make variants, IIRC?
04:18
<~Vornicus>
I want to experiment with new languages sometimes but
04:18
<~Vornicus>
I don't want to fuck around with the seemingly everpresent need to faff about with installing this gargantuan toolchain
04:19
< catadroid>
Jam is a hideous mess that happens to compile our code as what feels like an unintended side effect
04:19
<~Vornicus>
heh
04:19
<&McMartin>
This is also my opinion of Maven, Gradle, and CMake
04:19
<&McMartin>
Make itself is a hideous mess that is nevertheless definitely compiling your code as its primary effect.
04:20
< catadroid>
The only data type is a list of strings, and the whitespace before the ; is significant
04:21
<~Vornicus>
I remember when I was doing my catan art project
04:22
<~Vornicus>
which was postscript & rake
04:23
<~Vornicus>
I liked rake, because I could make a single source file generate many objects, and define those objects in a loop
04:24
<~Vornicus>
this was before I started to hate ruby.
04:24 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
04:25
<~Vornicus>
--anyway, lisp seemed to me to have a lot in common with postscript and sql: there's this huge number of words that are commands in the language, because they couldn't figure out libraries
04:25 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
04:25 mode/#code [+o himi] by ChanServ
04:26
<&McMartin>
Hackers of old hate libraries
04:26
< catadroid>
That's honestly how clojure feels to me, and Haskell
04:26
<&McMartin>
You can tell because our modern system for libraries that don't interfere with each other and everything else was more or less yoinked from Ada by way of Modula-2
04:26
<&McMartin>
And everyone hates those~
04:26
< catadroid>
Haskell feels like it's very much intending to be a language of Global Truths to the point of ignoring how actual software development works
04:26
<&McMartin>
Haskell, like Lisp and Algol, started out as a way to write papers on computation theory :)
04:27
<&McMartin>
Global Truths were kind of the point
04:27
< catadroid>
Yeah, but people talk about it the same way they talk about Linux for the desktop
05:27 Derakon is now known as Derakon[AFK]
06:24 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
06:45 celticminstrel [celticminst@Nightstar-ehtgrr.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:36 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
07:50 gizmore [kvirc@Nightstar-vo9c7g.dip0.t-ipconnect.de] has joined #code
08:02
<&jeroud>
Go learn OCaml, people. It's the language I have the least hate for per line of code written.
08:02
<&jeroud>
By orders of magnitude.
08:04
<~Vornicus>
Do I have to faff about with a toolchain that isn't a one-click install away
08:06
<&[R]>
<McMartin> Make itself is a hideous mess that is nevertheless definitely compiling your code as its primary effect. <-- I've seen SAs use make to build config files actually
08:14 Kindamoody[zZz] is now known as Kindamoody
08:15
<&McMartin>
There's a lot to like about OCaml but it's never had the deployment environments that I can reasonably use.
08:17
<~Vornicus>
so yes, I would have to faff about with a toolchain that isn't a one-click install away
08:18
< catadroid>
I should learn OCaml for several reasons
08:24
<&jeroud>
Its package manager (opam) is among the nicest I've ever used.
08:24
<&jeroud>
Its build tools lack maturity, but aren't actively bad.
08:28 Kindamoody is now known as Kindamoody|afk
08:31
< catadroid>
Go's actually surprised me by how easy it is to build with
08:33
<~Vornicus>
I'm used to, nowadays, Python, Love2d, and Javascript, where the tools are literally "install this one thing" in the first two cases and "open it in your web browser" in the third
08:33 * catadroid nods
08:36
<&[R]>
I've still yet to get Go to compile successfully
08:37
<&[R]>
For whatever reason Google loves giant overcomplicated and brittle build systems (Chrome is the same)
08:37
<&jeroud>
catadroid: Go's surprised me with how hard it is to get a dev environment set up.
08:37
<&jeroud>
I also don't like the language much.
08:38
<&[R]>
I was unsurprised (I tried and failed to do Chrome myself previously)
08:38
<&jeroud>
I knew it was bad, but I thought it would at least be documented.
08:40 ion [Owner@Nightstar-6grqph.vs.shawcable.net] has joined #code
08:40 mode/#code [+o ion] by ChanServ
08:40
<&jeroud>
Vornicus: I'd put OCaml's tooling on about the same level as Python's.
08:41
< catadroid>
I actually really like Go, despite its flaws
08:41
<&jeroud>
The package management stuff is a little better, the build stuff is a little worse.
08:41
<&jeroud>
catadroid: I can't get past how a 21st century language has such a primitive type system.
08:42
<&jeroud>
And signature-only interfaces have been a terrible idea for decades.
08:42
< catadroid>
Okay, I like precisely one thing about Go specifically
08:42
< catadroid>
Which is the fact it has channels as a first class concept
08:42
<&jeroud>
Also a terrible idea: Not making tea.
08:42
< catadroid>
Tea is important
08:43
<&jeroud>
catadroid: I'm not saying you should hate it or anything. There are some nice ideas in it.
08:44
<&jeroud>
I'm also biased by the fact that almost everything I need to use that's written in the language *cough*docker*cough* is terrible.
08:45
< catadroid>
Using the 'it's $year' argument kind of annoys me I suppose
08:45
<&jeroud>
It's a valid argument, though.
08:46
< catadroid>
It's 2016, why is my code not compiling?
08:46
< catadroid>
I mean come in
08:46
< catadroid>
On*
08:46
<&jeroud>
In terms of "have we not learned from the mistakes of the past?"
08:46
< catadroid>
No
08:47
<&jeroud>
COBOL is a terrible language, but it's also how we learned that certain things just don't work well.
08:47
< catadroid>
I mean, they still insist that automatically inserting semicolons instead of improving the language grammar
08:47
< catadroid>
Is a good plan
08:51
<&jeroud>
The thing that annoys me most about Go is really how the language features directly contradict the stated design philosophy.
08:52
<&[R]>
Such as?
08:52
<&jeroud>
"Safe type system", except you're forced into using "interface{}" to write any useful generic code.
08:53
<&jeroud>
"Exceptions are bad", and then you get panics which are like exceptions only worse.
08:54
<&jeroud>
There are more, but those are the two that jump out at me most.
08:56
<&jeroud>
If you're designing a language this decade and you claim "safe type system" as a major feature, I expect you to have looked at a bunch of different type systems that are already in common use and be able justify your design decisions in comparison to those.
08:57
< catadroid>
Oh, if they claim they have a safe type system then yeah, that's pretty egregious
08:58
<&jeroud>
I don't like the JS type system either, but nobody has ever tried to claim that it helps you write safer code.
09:00
<&jeroud>
catadroid: For a trivial built-in example of why signature-only interfaces are bad, look at os.Signal.
09:00
<&jeroud>
This is a thing that was designed long after zope.interface existed.
09:02
<&jeroud>
Anyway, I'm older and grumpier today than I was yesterday, so try not to let my attitude dampen your enthusiasm.
09:04
<&jeroud>
(The grumpiness is more related to sleeping badly than the solar orbit counter increment.)
09:29 gizmore [kvirc@Nightstar-vo9c7g.dip0.t-ipconnect.de] has quit [Operation timed out]
09:30 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has joined #code
09:46
< catadroid>
Things that are cool: the Lua game mode state machine system I setup for a game we released in 2011 is still being used
09:47
<~Vornicus>
Nice.
09:58
< catadroid>
Especially since it was entirely out of necessity and there was no real up front design
10:00 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
10:00 mode/#code [+o Emmy] by ChanServ
10:23
<@ion>
I'm pretty sure I've found a bug in dropbox
10:23
<@ion>
edited a text file I keep on my computer with android
10:24
<@ion>
buh-bye EOL characters
10:27
< catadroid>
jeroud: that looks more like an interface issue than a global type issue?
10:29
< catadroid>
As in the name they chose was bad
10:30
< catadroid>
Having said that, I'm near certain that most complexity issues of that type come down to poor scoping choices
10:31
< catadroid>
I'm assuming by context that zope.interface is something you consider bad design
10:42 catadroid` [catadroid@Nightstar-act8ul.dab.02.net] has joined #code
10:46 catadroid [catadroid@Nightstar-8jlt7o.dab.02.net] has quit [Ping timeout: 121 seconds]
10:50 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has quit [[NS] Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
11:08
<@simon>
catadroid`, apropos jeroud's grumpiness, did you have any enthusiasm for Go before his rant? :)
11:09
<@simon>
the only good thing about Go that I can think of is its fast compiler.
11:09
<@simon>
I can't believe they don't even have parametric polymorphism.
11:25
< catadroid`>
I've potential enthusiasm for things that I've not used in anger yet
11:25
< catadroid`>
That may dissipate
11:25 catadroid` is now known as catadroid
11:26
< catadroid>
I do think that people are somewhat too obsessed by typing to the exclusion of other aspects of program design at the moment, though
11:27
< catadroid>
Having said that, the lack of parameterised types is on my warning lights list :p
11:28
<~Vornicus>
type is a proxy for a staggering number of safety things. done to the extreme, type prevents you from using a velocity as a location
11:29
<~Vornicus>
or using an unsafe string in a safe place
11:29
<&[R]>
By extreme you mean properly?
11:30
<~Vornicus>
I've never met a system that actually bothers using two different types for velocity and location, so
11:35 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
11:41 Emmy is now known as Emmy-AFK
11:49
< catadroid>
I've had a programmer ask me repeatedly to separate our vector types into position and offset types
12:13
<@Azash>
Is it possible to write an array implementation with O(log n) insertion into a sorted array without using a balancing tree behind the scenes?
12:28 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has joined #code
12:43 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has quit [A TLS packet with unexpected length was received.]
12:48
<@simon>
Azash, I'm not sure I understand what "insertion into a sorted array" means.
12:49
<@simon>
Azash, the array has a fixed size, so you would either overwrite an existing value, or extend/re-allocate the array.
12:50
<@simon>
Azash, assuming the array hasn't been filled yet, and re-allocation isn't a part of the problem, you could use the array as a kind of tree.
12:51
<@simon>
but eh, I can't think of a way to get O(lg n) lookups that doesn't correspond, at least abstractly, to a tree lookup.
13:25
<@Pi>
Azash: You can find the insertion point in O(log n) comparisons (binary search)
13:25
<@Pi>
Azash: But for a linear array / vector, the insertion itself will be O(n)
13:25
<@Pi>
Depending on what you're doing, a heap may be appropriate here instead?
14:19 JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code
14:19 JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [NickServ (RECOVER command used by JustLurk)]
14:19 JustLurk is now known as JustBob
14:19 mode/#code [+o JustBob] by ChanServ
14:27
<@simon>
ah yes, a heap was what I was thinking of.
14:53
<@Azash>
Yeah it was an academic question
14:54
<@Azash>
Also iirc heaps are not ordered, just hierarchic by value
15:26 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has joined #code
16:20
<&jeroud>
catadroid: zope.interface is a thing I like.
16:20
<&jeroud>
Also, interface{} in Go is basically void*.
16:21
<&jeroud>
In order to get anything useful through it, you need casts.
16:21
< catadroid>
Aye, that I understand, although aiui the language carries rtti along with the value?
16:22
<&jeroud>
There's no clean way to implement a generic container.
16:22
< catadroid>
Yeah, I've not determined if that annoys me yet
16:22
<&jeroud>
IIRC there's no way to do it at all without compiler warnings.
16:23
< catadroid>
Because you can have generic containers, you just can't determine their correctness at compile time nor depend on them being optimised as such?
16:23
<&jeroud>
I don't care if the value is opaque.
16:23
< catadroid>
Again, I'm going on what I've read not what I've programmed
16:23
<&jeroud>
I don't care about optimisation.
16:23
< catadroid>
Also, there are no compiler warnings
16:24
< catadroid>
presumably the best you can do is a structure based on interface{} values, akin to how standard container types are written in C?
16:24
<&jeroud>
I care about being able to put things in a container and take them out again with the compiler catching the places where I screw up the types.
16:25
< catadroid>
Sure, so like I said you presumably can't test that statically
16:25
<&jeroud>
Not in Go.
16:25
< catadroid>
Yes, that's what I mean
16:26
< catadroid>
Remember that I have extensive knowledge of C++, so I understand why not being able to is an issue
16:26
<&jeroud>
Which means its type system isn't safe for a large class of useful code.
16:27
<&jeroud>
I don't see the point of any static type system that can't give me that.
16:28
< catadroid>
I'm not disagreeing with you, but from the perspective of C, it's safer. I agree it's hardly state of the art.
16:29
< catadroid>
Hence why they likely make that assertion
16:30
<&jerith>
Sure, but C is older than I am.
16:31
< catadroid>
So is Rob Pike
16:32 Namegduf [namegduf@Nightstar-lcgn9d.beshir.org] has quit [Ping timeout: 121 seconds]
16:34 Namegduf [namegduf@Nightstar-lcgn9d.beshir.org] has joined #code
16:34 mode/#code [+o Namegduf] by ChanServ
16:35
<&jerith>
Sure.
16:39
< catadroid>
You are welcome to be angry, I'm just trying to understand limitations and implementation details, heh
16:42
<&jerith>
I'm not particularly angry except when I have to use it.
16:49
<&jerith>
I'm mostly sad that so much effort and energy has gone into something so obviously flawed.
16:49
<&jerith>
At least JS has the excuse of its history. :-P
17:01 gizmore [kvirc@Nightstar-7b67oi.dip0.t-ipconnect.de] has quit [Operation timed out]
17:08 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
17:11
< catalyst>
https://www.youtube.com/watch?v=fAY0_pesZ6s is the best talk I've ever watched, btw
17:12 catadroid` [catadroid@Nightstar-hr17iu.dab.02.net] has joined #code
17:12 catadroid` [catadroid@Nightstar-hr17iu.dab.02.net] has quit [[NS] Quit: Bye]
17:14 catadroid [catadroid@Nightstar-act8ul.dab.02.net] has quit [Ping timeout: 121 seconds]
17:19
<&jerith>
catalyst: Thanks, I'll take a look.
17:22 gizmore [kvirc@Nightstar-j5f7hv.dip0.t-ipconnect.de] has joined #code
17:26 celticminstrel [celticminst@Nightstar-ehtgrr.dsl.bell.ca] has joined #code
17:26 mode/#code [+o celticminstrel] by ChanServ
17:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
17:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:24 Derakon[AFK] is now known as Derakon
20:22 Kindamoody|afk is now known as Kindamoody
20:45
<&McMartin>
Man, I've lost some sanity, clearly
20:45 * McMartin writes his first code review on the order of "this class hierarchy isn't an idiomatic class hierarchy for Objective-C"
20:50
< catalyst>
._.
20:50
< catalyst>
what is? :P
20:56
<&McMartin>
For this, one that doesn't actually use inheritance
20:56
<&McMartin>
They've got what is basically a listener class that does some of its own work to set up event triggers, etc. and then calls its own methods when the events happen
20:56
<&McMartin>
One would use the class by subclassing this listener class and implementing those methods.
20:57
<&McMartin>
The way situations like this are handled throughout iOS is that you have a class that is completely implemented that does all the setup and event trigger work
20:57
<&McMartin>
And it can be subscribed to with objects that implement an interface that is one-method-per-event-that-matters
20:58
<&McMartin>
So custom behavior is obtained by implementing that interface ("protocol" in ObjC-ish, "interface" in Go) and registering yourself with that event system
20:59
<&McMartin>
There's a couple other bits that seem more common in ObjC code than elsewhere that are kind of quirky
21:00
<&McMartin>
Like, instead of having a more traditional one-to-many publish/subscribe model they like to have a one-to-one one, where you create a listener system as one your fields and then pass it a single weak reference to yourself
21:00
<&McMartin>
But that's not important for this review; doing it the "idiomatic" way would cut the boilerplate he needed to get this to work almost in half
21:01
<&McMartin>
So I feel OK saying I have a pretty good handle on how to make its interfaces be "clean"
21:01
<&McMartin>
I'm curious how much of this design sensibility translates to Go, actually, given how similar Obj-C protocols and Go interfaces seem to be.
21:07 * Vornicus decides he doesn't feel like trying to compensate for going over HUGE
21:09
<&McMartin>
?
21:10
<~Vornicus>
(a + b) / 2 can fail to come out between a and b inclusive if |a + b| > HUGE
21:13
<~Vornicus>
(it will instead be infinity)
21:14
<@celticminstrel>
How...?
21:14
<&McMartin>
a+b overflows
21:15
<@celticminstrel>
I suppose if overflow sets it to infinity...
21:15
<&McMartin>
And I guess a and b are IEE754 floating-point values
21:15
<&McMartin>
Where that does indeed happen
21:15
<@celticminstrel>
Ah.
22:37 gizmore [kvirc@Nightstar-j5f7hv.dip0.t-ipconnect.de] has quit [[NS] Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
23:32 Kindamoody is now known as Kindamoody[zZz]
23:35 Emmy-AFK [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
23:51 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [Connection closed]
--- Log closed Sat Sep 03 00:00:42 2016
code logs -> 2016 -> Fri, 02 Sep 2016< code.20160901.log - code.20160903.log >

[ Latest log file ]