|
is this on github I must see this
|
# ? Aug 31, 2018 04:11 |
|
|
# ? Apr 27, 2024 16:05 |
|
Bloody posted:what the gently caress yep, I’m gonna need more explanation of this one
|
# ? Aug 31, 2018 04:13 |
|
animist posted:my current project is a webassembly -> verilog compiler in rust seriously what is the motivation
|
# ? Aug 31, 2018 04:27 |
|
what does it even mean webassembly is, i presume, something like a procedural language at some level
|
# ? Aug 31, 2018 05:09 |
|
DONT THREAD ON ME posted:i have a basic generic linked list and if i want to define map it's all pointers to void and casting. pretty gross.
|
# ? Aug 31, 2018 05:49 |
|
Shaggar posted:as a childless nerd I can confirm factorio is far more interesting than learning a research language. SHAGGAR IS RIGHT AGAIN bad sign
|
# ? Aug 31, 2018 06:22 |
|
the real mindkiller is having a kind of fulfilling day job (go figure) -- absolutely zero interest in computer programming when i do even somewhat fun, interesting or novel things at work my github.com contributions graph is like the perfect inverse of when i'm happy at work
|
# ? Aug 31, 2018 06:26 |
|
redleader posted:i'm extremely jealous of how motivated you are to do things
|
# ? Aug 31, 2018 06:35 |
|
What's a legit alternative to clusters of nodejs express servers behind a load balancer?
|
# ? Aug 31, 2018 07:19 |
|
qhat posted:What's a legit alternative to clusters of nodejs express servers behind a load balancer? clusters of golang servers behind a load balancer
|
# ? Aug 31, 2018 08:15 |
|
Sapozhnik posted:dont do c++ its super bad Sapozhnik posted:otoh c is fine for what it is
|
# ? Aug 31, 2018 08:17 |
|
prisoner of waffles posted:some states? have data breach laws. like if your company know that a lot of personally identifying information has been lost to the haxors, your company may be required to let people know. https://mobile.twitter.com/internetofshit/status/1034573568418476032 https://mobile.twitter.com/gonadic_io/status/1034592697674285056
|
# ? Aug 31, 2018 08:20 |
|
but share prices
|
# ? Aug 31, 2018 08:25 |
|
Ultimately if your boss is on paper saying they're OK with the product being easily hackable then you can escalate (to their boss, or idk press or some regulatory agency for your industry), do nothing, or keep trying to convince your manager. Not sure what other options there are
|
# ? Aug 31, 2018 08:52 |
|
Non tech management caring about security/hackability is a double-edged sword believe me
|
# ? Aug 31, 2018 08:53 |
|
It is by will alone I set my mind in motion. It is by the chip of Dorito that thoughts acquire speed, the fingers acquire stains, the stains become a warning. It is by will alone I set my mind in motion. *eats dorito* https://twitter.com/LuigiThirty/status/1035443417130717184
|
# ? Aug 31, 2018 09:42 |
|
ctps: got the first screen of space invaders to render but then it segfaults. gotta put this down for the weekend though i dont want to
|
# ? Aug 31, 2018 14:44 |
|
I was searching for a solution to a dumb xml deslerialisation problem (yes this again, I only work on this poo poo on Fridays) and I think the posters response to the answer adequately sums up my experience with this:https://stackoverflow.com/questions/46576778/c-sharp-xml-array-deserialization-returns-only-first-element posted:Thank you a lot! But who's gonna return me back 6 hours of my life?
|
# ? Aug 31, 2018 14:51 |
|
ctps: I don't know which is dumb: Go's automatic pointer dereferencing, me, or both Like, I understand pointers, conceptually, but because Go uses pointers but automatically dereferences them most of the time I never really know what's happening. Like today I have a thing coming in that's an interface{} and I'm trying to unbox it into a *turd, which I want to then dereference so I can run it through the lovely Go JSON serializer (which apparently is turning my pointer into {} instead of dereferencing it and giving me {"TurdType":"brown"}) edit: oh naturally, the answer is "use reflection": https://stackoverflow.com/questions/49540367/how-do-i-dereference-a-pointer-value-passed-as-the-empty-interface jesus h loving dipstick christ
|
# ? Aug 31, 2018 15:34 |
|
go was my first introduction to pointers and it's a confusing language to learn them in.
|
# ? Aug 31, 2018 16:16 |
|
Finster Dexter posted:ctps: I don't know which is dumb: Go's automatic pointer dereferencing, me, or both uhhhh maybe the problem is that you have turd.turdType and not TurdType? https://play.golang.org/p/d7Gdjxa5blH code:
{"Fart2":"b"} {"Fart2":"b"} {"Fart2":"b"} {"Fart1":"a","Fart2":"b"} {"Fart1":"a","Fart2":"b"} {"Fart1":"a","Fart2":"b"} Program exited.
|
# ? Aug 31, 2018 16:21 |
|
I think part of why people hate on go so much is because perhaps too many of the people now writing blogposts about how "it's so fweaking awesome" are not much more insightful than the crowd succinctly mocked by the "mongodb is webscale" computer-generated voiceover vids? like a good answer to that stackoverflow question is "what the gently caress are you doing? why aren't you using the stdlib database package?" and if indeed their usecase requires that they have a different interface and be able to unmarshal into any struct, then indeed they do need reflection, there's no way to git'r'dun without reflection trash-tier programming and thinking happens regardless of programming language
|
# ? Aug 31, 2018 16:29 |
|
yes people hate it because its a bad language with bad foundations promoted by bad developers. exactly the same reason everyone hated mongodb
|
# ? Aug 31, 2018 16:31 |
|
like if they really need to be able to pass in a pointer to Basically Any Type as an interface{} and unmarshal a value from a db into it, they need to use A LOT MORE REFLECTION than their code currently contains
|
# ? Aug 31, 2018 16:31 |
|
when i was dealing with go sql, i dealt with this problem by writing a query builder where the select statement builder would track the types of the selected columns and then it would know what to unmarshall each element of the result tuple into. this breaks down in a lot of cases but it still worked way better than it should. no reflection! still needed to manually map the result set into the target struct, but at least the types of each element would be known so you don't have to cast everything positionally.
|
# ? Aug 31, 2018 16:59 |
|
DONT THREAD ON ME posted:when i was dealing with go sql, i dealt with this problem by writing a query builder where the select statement builder would track the types of the selected columns and then it would know what to unmarshall each element of the result tuple into. this breaks down in a lot of cases but it still worked way better than it should. no reflection! congrats you build your own type system
|
# ? Aug 31, 2018 17:02 |
|
gonadic io posted:congrats you build your own type system even back then i was mad 4 types
|
# ? Aug 31, 2018 17:04 |
|
dapper maps db types to c# types using reflection for property/parameter type/name matching, but it also caches that mapping. You can manually specify mapping as well but that defeats the point of using dapper.
|
# ? Aug 31, 2018 17:05 |
|
yeah i mean i don't think reflection is the wrong approach but nothing in the go stblib makes it easy for you. which is honestly fine i dunno why the stlib has a sql abstraction.
|
# ? Aug 31, 2018 17:10 |
|
Lack of generics is annoying, too.
|
# ? Aug 31, 2018 17:19 |
I'm surprised that Go has pointers, although I guess I shouldn't be because it's so C-inspired. It's just I've never seen pointers in a garbage-collected language before. I'm guessing this means things in Go are copied on assignment / being passed to a function, and pointers are a way to explicitly avoid that copy? Is there ever a way to get a dangling pointer in Go, or does having a pointer to an object prevent that object from being garbage collected?
|
|
# ? Aug 31, 2018 17:20 |
|
VikingofRock posted:I'm surprised that Go has pointers, although I guess I shouldn't be because it's so C-inspired. It's just I've never seen pointers in a garbage-collected language before. I'm guessing this means things in Go are copied on assignment / being passed to a function, and pointers are a way to explicitly avoid that copy? Is there ever a way to get a dangling pointer in Go, or does having a pointer to an object prevent that object from being garbage collected? this is the best info i can find really: https://golang.org/doc/faq#Pointers i think it's not that different from java in practice DONT THREAD ON ME fucked around with this message at 17:30 on Aug 31, 2018 |
# ? Aug 31, 2018 17:28 |
|
prisoner of waffles posted:I think part of why people hate on go so much is because perhaps too many of the people now writing blogposts about how "it's so fweaking awesome" are not much more insightful than the crowd succinctly mocked by the "mongodb is webscale" computer-generated voiceover vids? All the other languages should have won but somehow all have managed to shoot themselves in the foot in various ways so we're left with languages like python and go winning.
|
# ? Aug 31, 2018 17:40 |
|
not to mention javascript on the backend
|
# ? Aug 31, 2018 17:43 |
DONT THREAD ON ME posted:this is the best info i can find really: Okay yeah after reading through that it looks like assignment and argument passing both invoke a shallow copy of the data, and there's no way to get a dangling pointer without using unsafe.Pointer. It's been a long time since I used Java so I can't remember how memory semantics work there. The only GC languages I commonly used nowadays are Python and Haskell. I've only recently felt like I really understood Python's assignment semantics and in Haskell things are generally immutable so it mostly doesn't matter whether things are copied deeply, shallowly, or not at all.
|
|
# ? Aug 31, 2018 17:43 |
|
VikingofRock posted:Okay yeah after reading through that it looks like assignment and argument passing both invoke a shallow copy of the data, and there's no way to get a dangling pointer without using unsafe.Pointer. speaking of assignment semantics, rvalue references are weird after doing rust. other weird c++ stuff: 1. templates are not generics. they're so weird! they feel both more and less powerful than generics. 2. ugh, the class system... 3. googling for things is bad. online documentation is bad. cpp reference is the best resource i've found, and i can't imagine learning from this if I were new to programming holy poo poo. 4. exceptions look like a rabbit hole 5. no interfaces or traits, just abstract classes. i'm sure there are some more esoteric mechanisms for these things though. i really love interfaces though and cant imagine programming without them. you can really feel the age of the language. i think i was expecting "modern" c++ to feel more modern but it really doesn't. esp the OO stuff, which was like, the original impetus for the language, but is now not really the selling point it used to be,. DONT THREAD ON ME fucked around with this message at 18:06 on Aug 31, 2018 |
# ? Aug 31, 2018 17:59 |
DONT THREAD ON ME posted:speaking of assignment semantics, rvalue references are weird after doing rust. I pretty much agree with all of your impressions. C++ was the first language I got comfortable with, and I basically did it by reading through an Herb Sutter book followed by one of the Scott Meyers books (this was around 2010 so I was learning C++03). Those two authors come from a specific school of C++ thought which basically says that you should pretty rarely use inheritance at all. Templates cover a lot of the same functionality that you would use traits / interfaces for; just think of the constraints as being implicit from the function that you are writing ("I use the + operator here") instead of explicit ("my arguments implement Addable").
|
|
# ? Aug 31, 2018 18:19 |
|
c++11 has traits as part of its stdlib
|
# ? Aug 31, 2018 18:23 |
Also now that I've thought a little more on Go's shallow-copy-on-assignment, I'm a little perturbed by it. It seems to me like that breaks encapsulation a bit too much. For example, if I'm using a Point3D type, I shouldn't worry if internally the x, y, and z coordinates are stored as three separate member floats or as a single vector of three floats. But with shallow copy semantics, all of the sudden those are very different semantically if I pass a Point3D to a function and then mutate one of the coordinates. Admittedly I've never used Go so it's possible I'm misreading the copy semantics or that there are idioms which mitigate this issue. But as I understand it it seems like a weird choice to me.
|
|
# ? Aug 31, 2018 18:25 |
|
|
# ? Apr 27, 2024 16:05 |
|
I was taught this about inheritance from my mentor: Inheritance is cool and good, but can get you into trouble quickly. If you go more than 2 levels of inheritance, you need to take a good long look at your code and probably refactor it.
|
# ? Aug 31, 2018 18:26 |