|
Athas posted:Can you explain? This always seemed like a harmless if idiosyncratic design. I know of the ways people claim it can be annoying, but has it really been so in practice? it just leads to bizarre gotchas. the original presentation iirc was rob pike using "capital" and "lower case" greek letters as an illustration code:
|
# ? May 28, 2019 07:59 |
|
|
# ? Jun 6, 2024 02:29 |
|
to be clear i think go is fine for making cli tools since its easy to get cross compiled static binaries out of it unless you want to use, for example, os.user from the standard library. you'd think that the library that provides platform-specific paths to things would be expected to work in cross-compiled builds, but no, it fails at runtime if the build was cross-compiled on a different OS (or did circa 9 months ago on latest) so even in its ideal use case golang still finds ways to be obnoxious to deal with
|
# ? May 28, 2019 08:05 |
|
Blinkz0rz posted:it's not silent, go is quite up front about exported and unexported fields. same deal with struct tags too. none of this is foreign to anyone who has read the documentation much less been through the learn go by example tutorial so why should fmt.Printf("%v+") be able to retrieve unexported fields just fine when json.Unmarshal() cant find them? see above
|
# ? May 28, 2019 08:12 |
|
Progressive JPEG posted:Jenkins implements rpcs by serializing Java objects and sending them over the wire to workers so you must have exactly the same jre across all Jenkins nodes
|
# ? May 28, 2019 08:26 |
|
code:
for example: code:
|
# ? May 28, 2019 09:56 |
|
Progressive JPEG posted:so why should fmt.Printf("%v+") be able to retrieve unexported fields just fine when json.Unmarshal() cant find them? see above Printf doesn't use the same mechanism for accessing fields as json.Unmarshal()? Be pedantic all you want but like, this isn't complicated stuff. It's certainly opinionated, but 1 of 2 changes would have indicated what was wrong and both are very clearly documented. 1. code:
code:
|
# ? May 28, 2019 11:52 |
|
i mostly agree that there is no real problem with go making what seems like naming conventions into semantics, improved brevity while also communicates the accessibility of the field in every place it is used. to some extent it is made ok only because go enshrines conventions a lot more deeply than other languages *anyway* though (i.e. the very real gofmt advantage)
|
# ? May 28, 2019 12:15 |
|
the way the go json deals with missing fields totally owns it's a great time love it thanks rob
|
# ? May 28, 2019 16:10 |
|
using the go json package is a constant parade of footguns and unhandled 'edge cases' that actually apply to every non trivial struct, 'read the documentation' is not an excuse for this
|
# ? May 28, 2019 16:12 |
|
pea brain: semantic whitespace galaxy brain: semantic capitalization
|
# ? May 28, 2019 16:13 |
|
suggestion: a language where all symbols are exported by default, but can be marked as non-exported by including a zero-width-non-joiner character somewhere in the name i don't see any problems with this. it wouldn't be confusing because ides could display non-exported names in a different color, and auto-complete would solve the problem of typing the non-joiner in the right place
|
# ? May 28, 2019 16:58 |
|
Soricidus posted:suggestion: a language where all symbols are exported by default, but can be marked as non-exported by including a zero-width-non-joiner character somewhere in the name
|
# ? May 28, 2019 17:00 |
|
is there a way to customize (de)serialization for a type at all, or does go just assume that that’s only useful for builtin types
|
# ? May 28, 2019 18:10 |
|
🚨 white smoke from the rust conclave 🚨
|
# ? May 28, 2019 18:27 |
|
rjmccall posted:is there a way to customize (de)serialization for a type at all, or does go just assume that that’s only useful for builtin types yeah: https://golang.org/pkg/encoding/
|
# ? May 28, 2019 18:51 |
|
quote:I’m working actively on drafting a stabilization report to propose stabilizing a minimum viable version of async/await in the 1.37 release of Rust. 1.37 will be released in mid-August i declare May 28th, 2019 to be "the end of programming language history."
|
# ? May 28, 2019 18:52 |
|
is there a Rust implementation of L4 yet I suppose the Rust rewrites of Mach and BSD start in August
|
# ? May 28, 2019 19:04 |
|
eschaton posted:is there a Rust implementation of L4 yet https://fuchsia.googlesource.com/fuchsia
|
# ? May 28, 2019 19:16 |
|
there's also a unix-like hobby os written in rust out there sometimes i wonder if rust will be a Pixies to some Nirvana that hasn't been invented yet
|
# ? May 28, 2019 19:28 |
|
ah right, makes sense. so this public-fields-only stuff is just the default behavior for structs that don’t define custom encoding?
|
# ? May 28, 2019 19:31 |
|
Blinkz0rz posted:Printf doesn't use the same mechanism for accessing fields as json.Unmarshal()? Be pedantic all you want but like, this isn't complicated stuff. It's certainly opinionated, but 1 of 2 changes would have indicated what was wrong and both are very clearly documented. The amount of stockholm syndrome in this post is amazing.
|
# ? May 28, 2019 19:35 |
|
rust is laying the groundwork for the inevitable rust#, which will be the greatest general-purpose programming language of all time. the only important design decision difference between the two is that while rust is all about those zero-cost abstractions, rust# will accept nonzero-cost abstractions, allowing it to become the greatest language in the world
|
# ? May 28, 2019 19:59 |
|
just imagine: a real language like c# or java but with a borrow checker
|
# ? May 28, 2019 20:00 |
|
the greatest language already exists though, thanks to John McCarthy
|
# ? May 28, 2019 20:17 |
|
Bloody posted:just imagine: a real language like c# or java but with a borrow checker future so bright, I gotta post using amberpos
|
# ? May 28, 2019 20:29 |
|
akadajet posted:oracle doesn't want the message to get through. java is a trap. this is every oracle product heck even some DBAs i've worked with insist OracleDB is the hottest poo poo and best performing in the world. I mean sure but nanoseconds don't really count for much when you only need to call it once or twice per day.
|
# ? May 28, 2019 20:33 |
|
rjmccall posted:ah right, makes sense. so this public-fields-only stuff is just the default behavior for structs that don’t define custom encoding? yep and iirc you can override the json packages behavior by implementing your own encoders but i may be wrong there. if go were awful at serialization i don't think stuff like grpc would be so popular. the issue is just that the user friendly json package is annoying in a very go way.
|
# ? May 28, 2019 21:27 |
|
DONT THREAD ON ME posted:yep and iirc you can override the json packages behavior by implementing your own encoders but i may be wrong there. if go were awful at serialization i don't think stuff like grpc would be so popular. DONT THREAD ON ME posted:the issue is just that the user friendly json package is annoying in a very go way. its weird that go went with shoehorning capitalization into access handling in order to keep things "succinct", leading to weird side effects like the json module's behavior, while at the same time requiring incredibly clunky and verbose error handling everywhere else
|
# ? May 28, 2019 22:08 |
|
Xarn posted:The amount of stockholm syndrome in this post is amazing. do i wish public/private keywords existed? hell yeah do i feel the need to rehash language idiosyncrasies like they're not tools that have their uses and that honestly who gives a gently caress? nah life is too short
|
# ? May 28, 2019 22:45 |
|
Blinkz0rz posted:do i wish public/private keywords existed? hell yeah and yet here we are
|
# ? May 28, 2019 22:46 |
|
that go stuff looks like poop
|
# ? May 29, 2019 00:04 |
|
Fiedler posted:the code authored by microsoft is better but nobody's going to knife miguel's baby, so... the mono standard library is a real fuckin mess
|
# ? May 29, 2019 04:51 |
|
rjmccall posted:ah right, makes sense. so this public-fields-only stuff is just the default behavior for structs that don’t define custom encoding? your custom marshal logic (eg implementing a MarshalJSON method) can do w/e you want, but I think the public fields only stuff falls out of a restriction that the reflection package imposes, so the arbitrariness isn't quite within the encoding/json package
|
# ? May 29, 2019 05:20 |
|
Notorious b.s.d. posted:the mono standard library is a real fuckin mess yes. that's why it's marked for death. only the mono runtime survives.
|
# ? May 29, 2019 06:15 |
|
Vanadium posted:your custom marshal logic (eg implementing a MarshalJSON method) can do w/e you want, but I think the public fields only stuff falls out of a restriction that the reflection package imposes, so the arbitrariness isn't quite within the encoding/json package yeah, i mean, that's obvious, but i don't get why someone thought it was a good idea to default types into non-custom serialization using reflection in the first place. sure, you don't want people to have to hand-write the marshaling code, but that's why basically every language that's ever looked at this ended up at "require the type to declare that it's serializable, but synthesize the serialization code automatically if it isn't provided"
|
# ? May 29, 2019 07:25 |
|
that is perhaps where the languages started, but i think you'll find a lot that today take the position "look just turn this loving object into json (and vice-versa) with the least possible amount of developer effort"
|
# ? May 29, 2019 07:56 |
|
now that I think about it, I do at least prefer go's encoding/json quirks to java's latest trend of submersing everything in annotation hell it didnt work? did you forget to mark all your fields @UndiscoverableUntraceableBullshit? ugh you moron dont sign
|
# ? May 29, 2019 08:20 |
|
Does anyone have any links to intrinsics code like the stuff here? (ideally not using wrapper libraries that abstract them out)
|
# ? May 30, 2019 23:08 |
|
Progressive JPEG posted:now that I think about it, I do at least prefer go's encoding/json quirks to java's latest trend of submersing everything in annotation hell one of my okrs was making sure our api was 100% documented with swagger autogenerated from the code so i spent like 75% of the quarter adding annotations to data classes in kotlin. was a great use of my time
|
# ? May 31, 2019 00:07 |
|
|
# ? Jun 6, 2024 02:29 |
|
the talent deficit posted:one of my okrs was making sure our api was 100% documented with swagger autogenerated from the code so i spent like 75% of the quarter adding annotations to data classes in kotlin. was a great use of my time speaking of swagger, can anyone recommend some sort of formatter for making swagger documentation actually readable? product i'm working on consumes a horrible mess of deeply nested data structures and the default swagger view is horrible, but i can't for the life of me find anything that would consume the swagger api json and turn it into something nicer like msdn pages
|
# ? May 31, 2019 00:22 |