Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
abraham linksys
Sep 6, 2010

:darksouls:
lmao as of 2017 go actually added a concurrency safe map to their standard library (https://medium.com/@deckarep/the-new-kid-in-town-gos-sync-map-de24a6bf7c2c)

it is, of course, a `map[interface{}]interface{}`, meaning both keys and values are untyped, because go does not have generics :shepface: :shepface:

Adbot
ADBOT LOVES YOU

tak
Jan 31, 2003

lol demowned
Grimey Drawer
go is fine, and interface{} isn't that scary if you only use it when you actually need to

generics will be in the next version finally though

if you're using vscode for go use the nightly go plugin. there's a great official go language server that's been in the works for a while (gopls) included, which you can also use in any editor that supports the lang server protocol too

Nomnom Cookie
Aug 30, 2009



or use a big boy language like java that supports threads and types and has sophisticated concurrent data structures. this shits not hard devs just gotta reinvent that wheel

Nomnom Cookie
Aug 30, 2009



java slow lol!

DrPossum
May 15, 2004

i am not a surgeon

abraham linksys posted:

oh i have no problem with intellij CE really. i just have this weird quirky specific problem of wanting to do web dev on windows, using WSL(2), and intellij (even ultimate) doesn't yet support WSL.

i am cynical and expect that when they do support WSL it will be tied into the ultimate version, and i'm not going to give them the money for that for personal projects, but idk maybe by that point there will be an open source alternative since it seems they're generally chill with that (and they did already start work on some kind of base WSL communication extension that other extensions can use so that's an okay sign)

the other option, of course, is to not use WSL, and run my backend on windows in development. i don't love this because i'm not very familiar with windows and its way of doing things. i use docker in development to run services the backend relies on (postgres, redis), so if i could easily get those running in docker for windows, and get my java dev environment working correctly on windows, maybe it would be fine? but then i don't love running on windows in dev and deploying to linux in prod

i could also try running intellij through X on WSL which apparently people do and have some success with but it sounds kind of annoying (love to install cygwin in 2020)

Your mileage will vary, but I basically do this with kotlin and docker in Windows 10 with Intellij ultimate. I transitioned that project from linux a few months back and other than some gradle fuckery and changing accomodating docker's general Windows/Linux differences it with was surprisingly painless. Just make sure you have Windows 10 pro because home doesn't support the virtualization needed for docker.

DrPossum
May 15, 2004

i am not a surgeon

suffix posted:

lead javascript guy thinks http redirects is something programmers havee to write code to manually handle because apparently the node stack is just that broken?

i gis'd "lead javascript guy" and this is what i got

CPColin
Sep 9, 2003

Big ol' smile.
Turn your webcam off

Soricidus
Oct 21, 2010
freedom-hating statist shill

Nomnom Cookie posted:

or use a big boy language like java that supports threads and types and has sophisticated concurrent data structures. this shits not hard devs just gotta reinvent that wheel

you can even compile it into a single self contained binary these days with graalvm. or run it straight from the source code like a plang if you’re allergic to compilers. java good

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


Soricidus posted:

you can even compile it into a single self contained binary these days with graalvm. or run it straight from the source code like a plang if you’re allergic to compilers. java good

when you think about it even (visual/CLI) c++ can be a plang imhbo*

*in my humble butt opinion

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


yeah Blazor is not quite there yet I don't think. It'll be cool if it does a take off a bit more though because a big pain point with c# mvc is having to glue poo poo together with bits of javascript if you're doing anything dynamic like adding elements to a list in a form on click, and while it's not hard (and the partial view engine and some extensions to how collections are managed make it way easier), it's like laying a trap for yourself when you change a class structure and then gently caress a view you forgot about.

when I tried using it it was really good for this because you basically just add a new element to your base list and the framework auto renders a new element or whatever, but the handling of nested objects was loving horrible with loads of passing of functions around up and down all with the wonderful "lol no compiler warnings until you run and get a stack barf" weakness of cshtml and the bonus of not being able to make changes without restarting like you could with razor

abraham linksys
Sep 6, 2010

:darksouls:

DrPossum posted:

Your mileage will vary, but I basically do this with kotlin and docker in Windows 10 with Intellij ultimate. I transitioned that project from linux a few months back and other than some gradle fuckery and changing accomodating docker's general Windows/Linux differences it with was surprisingly painless. Just make sure you have Windows 10 pro because home doesn't support the virtualization needed for docker.

good news/bad news on this one:

* good news: docker is moving to using wsl 2 as a host. unlike regular hyper-v, wsl 2 actually works on windows 10 home, which is pretty unexpectedly cool of ms

* bad news: intellij is still behind the curve on properly supporting wsl2, though, even compared to other jetbrains IDEs (https://youtrack.jetbrains.com/issue/IDEA-223986). that said, i guess if my source lives in windows, and is just mounted into docker-on-wsl, it should be okay, the same as what you have now?

i'm curious to know more about your setup! does intellij have built-in stuff for running inside docker you're using (debugging/running tests/etc)? i think i understand how you'd normally use docker for development on the command line (have a build folder with the app that's mounted into the docker fs, set up a dockerfile that just runs the app, restart docker any time you rebuild the app), but i don't really know how it'd work with intellij, especially the testing side of things.

if intellij is running gradle etc. in windows, you have to maintain your dependencies on windows and "just" mount the build output into docker, right? that seems kind of reasonable for java, since theoretically the jvm should be able to handle stuff built on one os and running on another, much better than, like, how you can't just copy-paste a `node_modules/` folder from one os to another if it has any native c dependencies since they need to be rebuilt

i think if i was living in a world where i was doing most of the work through an IDE, i actually wouldn't really give a poo poo whether it was running on windows or linux, tbh. for node/frontend dev i am in the command line most of the time and it'd be kind of weird, though. also i'd have to rewrite all my shell scripts, i guess? development "on windows" is so much more mysterious to me than this WSL stuff, but i'm not sure i actually have any technical blockers from preventing me from doing development on windows, other than just learning new poo poo

abraham linksys
Sep 6, 2010

:darksouls:

tak posted:

go is fine, and interface{} isn't that scary if you only use it when you actually need to

on one hand, i kind of disagree with this because type safety is the entire reason i've left the comfort of my p-lang shell and started trying all these other languages, so while i don't necessarily need haskell levels of type magic, i do want to not have to cast in and out of unknown on a regular basis.

that said, in practice, i see your point. like, basically every web framework i've seen in a static-typed language has middleware functions you can run that can store or read values on an "http request context." this way you can have a middleware function that goes like "if this user has an auth token, find their user from the DB and store it on the request context, so my route handlers can quickly grab the user from the context." in practice, the context is inevitably some kind of `map[string]interface{}` where you can store whatever the hell you want and just have to type cast on either side

i do like that in static type languages you can, y'know, type cast, instead of in JS either relying on nominal typing with instanceof (which is rarely useful because everyone just uses anonymous objects instead of classes), or writing duck-type runtime asserts for every single `unknown` value you have, which is a ton of boilerplate (and, in typescript, doubled boilerplate since you end up having to maintain that along with your static `interface`)

quote:

if you're using vscode for go use the nightly go plugin. there's a great official go language server that's been in the works for a while (gopls) included, which you can also use in any editor that supports the lang server protocol too

i'm using this and it's... not the worst editor experience i've had, but man, it's not great. i tried it like ~6 months ago and it was a loving wreck, so i can say now it's relatively usable, but it still cannot pick up new or moved files without me restarting the language server. i think everyone is having trouble getting a language server working well (i believe rust's is still similarly unstable) so i'm pretty sympathetic to it, but it's weird that a language that's been around a decade has such an immature tooling situation - like, i know language servers are new and there was an ecosystem of CLI tooling, but now all of that's been abandoned or deprecated and not updated to support the new go modules stuff, so as far as i can tell i'm stuck with this language server. or, uh, goland.

Soricidus posted:

you can even compile it into a single self contained binary these days with graalvm. or run it straight from the source code like a plang if you’re allergic to compilers. java good

i wanna try this at some point, but graalvm requires a lot of manual configuration if you're using libraries that involve any kind of reflection, which in the web dev world, is "most of them." that said most frameworks at least have tutorials for getting started with graalvm and i know some are specifically built for it (quarkus, micronaut), i just gotta figure out if i'll wind up wanting some dependency that doesn't work in a native context.

i've been using jib to produce super-lightweight docker images for deployment, which hasn't required much effort at all. my small javalin app hovers around 170 megs of memory which fits comfortably onto the cheapest digitalocean box you can get, along with postgres/redis/a node frontend server. i'm sure this is like 10x the footprint of a go server with the same functionality, but i feel like also took me 1/10 of the effort to write, so shrug

Nomnom Cookie
Aug 30, 2009



“untyped maps are fine just cast and don’t make mistakes” is some shameful java 1.4 era bs. a language that doesnt even have type erasure is just sad, and so are the justifications of plang-likers who have to act like every single thing about their trash fire is delightful. some things just suck. JavaScript sucks. go sucks. it’s ok to admit that your job requires you to use bad tools. it’s not fun to think about, but pretending that your plang spork is fit to dig ditches with doesn’t get the job done faster

FlapYoJacks
Feb 12, 2009
Is there even a reason to use any Plang other than Python?

Or if you want to compile things, use C++ >= 17 or Rust.

Nomnom Cookie
Aug 30, 2009



the only languages worth using in 2020 are java, rust, and python

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

Nomnom Cookie posted:

the only languages worth using in 2020 are java, rust, and python

watch shaggar shaggar in and add some .net langs

PIZZA.BAT
Nov 12, 2016


:cheers:


what's a good ui framework to use with spring boot? i've got my server up and running for a project i've been wanting to build and have built the spotify integration but now i want to make it look pretty

Notorious b.s.d.
Jan 25, 2003

by Reene

abraham linksys posted:

realized that by trying to build a stateful websocket server in a non-single-threaded language runtime for the first time i have opened myself up to an entire loving class of concurrency problems :shepface:

go's channels are super hard to reason about on this front, particularly. they really recommend you avoid atomic values or mutexes, and you're supposed to use channels instead, as described here. but that just seems like a terribly difficult pattern to use at scale in practice.

i guess a big part is just careful reasoning about what's truly shared - like, my app has a thing where users update their own state with websocket messages, but no other users can update that state. if a user is tied to a websocket connection (and there's a 1:1 user:socket relationship), and i've properly implemented the weird queue pump system this websocket library recommends to limit processing messages to one at a time per connection, i can theoretically assume that only one thing is touching that state at a time. which, like, is a lot to fuckin have to think about, versus the world i'm used to of "this poo poo's single threaded so as long as you never yield to the run loop through callbacks/yield/await you'll be fine to increment that counter or whatever"

i guess i could just start doing all my state management in some kind of database to serve as a "lock"? i guess that's not that weird, like, that's how you can handle multihreaded connections in regular ol' "stateless" http apps, your state lives in a database that is smart enough to handle a bunch of concurrent access. theoretically if i cared about scaling this app horizontally i'd want state in a db and some kind of pubsub broker anyways, maybe i'll just shove everything into redis

surprise: golang sucks

Notorious b.s.d.
Jan 25, 2003

by Reene

bob dobbs is dead posted:

watch shaggar shaggar in and add some .net langs

c# would be a good language if it weren't for that whole "microsoft" thing

the language is good, the ecosystem is impoverished

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

DELETE CASCADE posted:

it's actually the opposite of this. at the edges of your program, there are no types, it's just strings coming in and strings going out. ie the "universal interface" of unix pipelines. only inside your program do the types matter. you use them to express constraints in your program, like "this input is sanitized now" or "we are in this state" or "this data structure i am using has the following interface" and so on. you bother to do this because it takes away a lot of cognitive load while programming, since the type system is propagating constraints around for you. if it isn't removing cognitive load for you, then either the type system you are using sucks, or you are using it wrong

of course, but then there's truly no need for types anywhere

I'm damaged on the edge of my applications because I either have to interface with databases in one or both ends and databases are awful

Notorious b.s.d.
Jan 25, 2003

by Reene

tak posted:

go is fine, and interface{} isn't that scary if you only use it when you actually need to

lol at this nuclear hot take

tak posted:

generics will be in the next version finally though

the completely useless garbage type system is fine, except, even the language authors concede that it is utterly useless

Notorious b.s.d.
Jan 25, 2003

by Reene

Boiled Water posted:

of course, but then there's truly no need for types anywhere

I'm damaged on the edge of my applications because I either have to interface with databases in one or both ends and databases are awful

databases are great, usually the only good part of an application (i.e. where the data makes sense and has types assigned)

Bloody
Mar 3, 2013

whats the least bad way to write-once run-everywhere apps? react native? this is for like an idiot spare time prototype-tier crud project

Notorious b.s.d.
Jan 25, 2003

by Reene

PIZZA.BAT posted:

what's a good ui framework to use with spring boot? i've got my server up and running for a project i've been wanting to build and have built the spotify integration but now i want to make it look pretty

if you have a java thing and you don't know what to use as a default component look at dropwizard

http://dropwizard.io

this started as a "batteries included" model for "how do i java web app" but keeps growing

their default setup is mustache for templating and jersey for http forms/apis , and those seem like pretty reasonable choices to me?

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Notorious b.s.d. posted:

c# would be a good language if it weren't for that whole "microsoft" thing

the language is good, the ecosystem is impoverished

is there an open source community in c# yet or is it all do as microsoft has deigned correct?

Notorious b.s.d. posted:

databases are great, usually the only good part of an application (i.e. where the data makes sense and has types assigned)

usually being the operative word. My local DBA (who has veto rights on application architecture for some :psyduck: reason) has lot of weird and annoying thoughts about the db. Such as allowing duplicate information, but then having a bespoke db function which cleans up and marks rows as done. No it can't run automatically once in a while, developers should call it in their code.

Notorious b.s.d.
Jan 25, 2003

by Reene

Boiled Water posted:

is there an open source community in c# yet or is it all do as microsoft has deigned correct?

not really

and much of what does exist is loving horrible (e.g. nuget, chocolatey)

Boiled Water posted:

usually being the operative word. My local DBA (who has veto rights on application architecture for some :psyduck: reason) has lot of weird and annoying thoughts about the db. Such as allowing duplicate information, but then having a bespoke db function which cleans up and marks rows as done. No it can't run automatically once in a while, developers should call it in their code.

ah, you are posting from 1989

you poor bastard

Eldred
Feb 19, 2004
Weight gain is impossible.

Boiled Water posted:

is there an open source community in c# yet or is it all do as microsoft has deigned correct?

.NET Core is open source, and Microsoft's docs even call out non-MS open source solutions from time to time like Polly for HTTP retries. Some of their domain- centric projects are open source too, like in healthcare, but in practice those are mostly updated by MS.

brand engager
Mar 23, 2011

Nomnom Cookie posted:

the only languages worth using in 2020 are java, rust, and python

Kotlin and swift are pretty good

abraham linksys
Sep 6, 2010

:darksouls:

Notorious b.s.d. posted:

c# would be a good language if it weren't for that whole "microsoft" thing

the language is good, the ecosystem is impoverished

yeah i think it's been weird that while reading a little bit about c#/asp.net i just have not seen anything other than like "we just use what microsoft offers," with the exception of folks using dapper instead of entity framework

i mean kotlin sorta has this problem in terms of "kotlin-first" ecosystem being primarily just jetbrains developers experimenting with half baked ideas (ktor, exposed) but you have, yknow, the whole fuckin jvm ecosystem to lean on there with pretty much any popular framework or library having some kind of compatibility layer if necessary

i noticed that in the asp.net docs they talk about a few open source projects that seem to be de facto standards in the community, like IdentityServer4 being used for auth (efb by Eldred here)

Nomnom Cookie posted:

the only languages worth using in 2020 are java, rust, and python

feel like once java records land in whatever the next java LTS version is i might give it a shot? until then kotlin seems like the way to go

brand engager
Mar 23, 2011

brand engager posted:

Kotlin and swift are pretty good

Also I wish kotlin would just steal the "if let" and "guard let" syntax from swift, it makes dealing with nullable stuff so much nicer

mystes
May 31, 2006

abraham linksys posted:

yeah i think it's been weird that while reading a little bit about c#/asp.net i just have not seen anything other than like "we just use what microsoft offers," with the exception of folks using dapper instead of entity framework
Before .net core, I think c# was really just a language that people were using to make windows desktop applications, and it didn't even have an actual package manager / repository for third party stuff.

Now that it has that stuff, hopefully the situation will start to improve.

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Notorious b.s.d. posted:


ah, you are posting from 1989

you poor bastard

i loving wish. I'm posting from a government IT project that has unlimited funds for more people, but not enough funds for good people

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

brand engager posted:

Also I wish kotlin would just steal the "if let" and "guard let" syntax from swift, it makes dealing with nullable stuff so much nicer

val yep = someNullable ?: return

you can get close

tak
Jan 31, 2003

lol demowned
Grimey Drawer

Nomnom Cookie posted:

or use a big boy language like java that supports threads and types and has sophisticated concurrent data structures. this shits not hard devs just gotta reinvent that wheel

goroutines and channels and builtin stdlib concurrency primitives seriously own

just don't use interface{} unless you actually need to and do type assertions (type cast basically)

it's fine, go types and interfaces are really nice

tak
Jan 31, 2003

lol demowned
Grimey Drawer

Nomnom Cookie posted:

“untyped maps are fine just cast and don’t make mistakes” is some shameful java 1.4 era bs. a language that doesnt even have type erasure is just sad, and so are the justifications of plang-likers who have to act like every single thing about their trash fire is delightful. some things just suck. JavaScript sucks. go sucks. it’s ok to admit that your job requires you to use bad tools. it’s not fun to think about, but pretending that your plang spork is fit to dig ditches with doesn’t get the job done faster

so use a typed map then

it's not hard

go is good, I will die on this hill

tak
Jan 31, 2003

lol demowned
Grimey Drawer

abraham linksys posted:

on one hand, i kind of disagree with this because type safety is the entire reason i've left the comfort of my p-lang shell and started trying all these other languages, so while i don't necessarily need haskell levels of type magic, i do want to not have to cast in and out of unknown on a regular basis.

you don't

like what language doesn't have something like type casting and interfaces? it's really not as big of a problem as people seem to think

generics will be really nice though

abraham linksys posted:



i'm using this and it's... not the worst editor experience i've had, but man, it's not great. i tried it like ~6 months ago and it was a loving wreck, so i can say now it's relatively usable, but it still cannot pick up new or moved files without me restarting the language server

make sure you actually have a recent gopls, sounds like you're on an older prerelease

the gopls wiki has pretty good docs if it's not upgrading the gopls lang server for you with the nightly go vscode plugin

goland is ok but has its own problems, especially with go modules

e: the gopls wiki design docs are very promising

tak fucked around with this message at 23:33 on May 8, 2020

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆

tak posted:

so use a typed map then

it's not hard

go is good, I will die on this hill

great idea
where do i find the typed map for my custom Fart object in the go standard library

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
the c# ecosystem is "impoverished" only because the framework is already pretty good so there's not much motivation to poo poo out packages like js or most oss languages seem to need to for basic stuff

i have only run into one situation in the last four years that i couldn't handle with the default framework plus what's available in the .net oss world (specifically: the .net core grpc libraries are not as flexible as the go ones)

the packages that are out there tend to not have a billion dependencies of their own either, which is nice

this is a pretty good list of what's out there: https://github.com/thangchung/awesome-dotnet-core

jesus WEP
Oct 17, 2004


mystes posted:

Before .net core, I think c# was really just a language that people were using to make windows desktop applications, and it didn't even have an actual package manager / repository for third party stuff.

Now that it has that stuff, hopefully the situation will start to improve.
this isn’t remotely true, nuget has been around a lot longer than core

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

ive basically never needed to use a third party library in a c# project because the stdlib is just that good

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply