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.
 
  • Locked thread
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

MALE SHOEGAZE posted:

at my startup our architecture is microservices and a message queue.

each microservice has its own mongo database, because this reduces coupling. allowing the services to access the same database would increase coupling, so if one service needs access to data in another service, the originating service will just dump the entire collection into the pipeline, and the consuming service will write out all of the entries into its own database.

whenever an entity in the database is updated, the responsible service will emit an update event, and dump the entire object into the pipeline. consuming services will then write it to their own db, taking extreme care to update any and all data associations (a traditional DB would of course enforce these relationships for you, but it's no loss because keeping data in sync is a totally trivial problem compared to coupling, which is the worst problem).

the architects of this system did not concern themselves with concurrency, because data races are trivial compared to coupling. we've simply forced each consumer to run on a single thread, because concurrency issues are difficult to solve and we have more important problems such as reducing the amount of coupling in our system.

naturally, this system contains json entities that can be over 1mb compressed. if a user updates a single field on one of these entities, the entire 1mb model will get dumped into the queue. if they update the model twice (or 100 times) it will get dumped into the queue each time. this in no way overwhelms the system.

a few months back, i introduced an RPC mechanism so that we could at least make synchronous calls between services in response to user events. today my lead informed me that we're going to deprecate the RPC system because it increases coupling.

this is how you architect a system with 12 microservices that cannot handle more than 4 or 5 concurrent users before falling over. Fortunately, since everything is so decoupled, the system at least maintains the appearance of working.

UPDATE: I posted the "you dont need microservices" article (https://codeahoy.com/2017/08/19/yagni-cargo-cult-and-overengineering-the-planes-wont-land-just-because-you-built-a-runway-in-your-backyard/) in my teams slack and so far it's been met with deafening silence.

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
tps: spent literally the entire work day stepping through spray json internals in intellij's debugger

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

tps: spent literally the entire work day stepping through spray json internals in intellij's debugger

my number one complaint with scala is that library code is generally not fun to understand

do you use akka? how do you like it? "erlang on the jvm" sounds like a decent enough idea but the framework is heavy-duty enough that I couldn't really get a feel for it in the afternoon i spent playing with it

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

my number one complaint with scala is that library code is generally not fun to understand

do you use akka? how do you like it? "erlang on the jvm" sounds like a decent enough idea but the framework is heavy-duty enough that I couldn't really get a feel for it in the afternoon i spent playing with it

we use akka-http, but i have absolutely no idea about how its internals work or model erlang. akka-http is a decent http framework, even if the turing-complete nature of its routes files (as opposed to play, which has static routes) can be annoying at times.

p.s. fun scala quiz (this is what i spent my day solving in our stack) - what does the following print when you sbt run it?
code:
trait Bar {
    val barVal = BigDecimal(0)
}

trait Foo { self: Bar =>
    val fooVal = barVal
}

object Hello extends Foo with Bar {
  println(fooVal)
}

MrMoo
Sep 14, 2000

MALE SHOEGAZE posted:

UPDATE: I posted the "you dont need microservices" article (https://codeahoy.com/2017/08/19/yagni-cargo-cult-and-overengineering-the-planes-wont-land-just-because-you-built-a-runway-in-your-backyard/) in my teams slack and so far it's been met with deafening silence.

Why isn't Mongo run as a micro service?

FamDav
Mar 29, 2008

gonadic io posted:

tps: spent literally the entire work day stepping through spray json internals in intellij's debugger

spray is the one that uses implicits for serializers right

iirc it's slower than everything else out there

gonadic io
Feb 16, 2011

>>=

FamDav posted:

spray is the one that uses implicits for serializers right

iirc it's slower than everything else out there

yes, yes and also harder to debug. trust me on that last one.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

we use akka-http, but i have absolutely no idea about how its internals work or model erlang. akka-http is a decent http framework, even if the turing-complete nature of its routes files (as opposed to play, which has static routes) can be annoying at times.

p.s. fun scala quiz (this is what i spent my day solving in our stack) - what does the following print when you sbt run it?
code:
trait Bar {
    val barVal = BigDecimal(0)
}

trait Foo { self: Bar =>
    val fooVal = barVal
}

object Hello extends Foo with Bar {
  println(fooVal)
}

lol i cant even remember how to run this without setting up an entire project. i'm guessing this prints null and those vals need to be lazy?

DONT THREAD ON ME fucked around with this message at 18:17 on Aug 21, 2017

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

lol i cant even remember how to run this without setting up an entire project. i'm guessing this prints null and those vals need to be lazy?

yes and yes.

and i didn't either, i used "sbt new scala/scala-seed.g8" which sets up the project for you. then just sbt run.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

yes and yes.

and i didn't either, i used "sbt new scala/scala-seed.g8" which sets up the project for you.

yeah, i tango'd with this same issue. using lazy to force initialization is totally counterintuitive.

gonadic io
Feb 16, 2011

>>=
interestingly while
code:
trait Bar {
    val barVal = BigDecimal(0)
}

trait Foo { self: Bar =>
    val fooVal = barVal
}

object Hello extends Foo with Bar {
  println(fooVal)
}
prints null,
code:
trait Foo with Bar {
    val fooVal = barVal
}
and
code:
object Hello extends Bar with Foo {
  println(fooVal)
}
each make it work

MononcQc
May 29, 2007

is that a dynamic scope for traits

gonadic io
Feb 16, 2011

>>=
https://stackoverflow.com/questions/1990948/what-is-the-difference-between-self-types-and-trait-subclasses

god scala is a mess

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

gonadic io posted:

interestingly while
...
each make it work

oh, I didn't realize that the issue only occurred with self types. that's...strange.

Shaggar
Apr 26, 2006
scala is for java developers who want to pretend they aren't using java.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
inside of scala there are 3 perfectly good languages trying to get out

JawnV6
Jul 4, 2004

So hot ...
i like it when a few pages go by and i don't even understand the class of error being discussed

gonadic io
Feb 16, 2011

>>=

Shaggar posted:

scala is for java developers who want to pretend they aren't using java.

yes. 100%.

e: note that this is an advantage of scala, not a disadvantage

gonadic io fucked around with this message at 19:16 on Aug 21, 2017

gonadic io
Feb 16, 2011

>>=

MALE SHOEGAZE posted:

inside of scala there are 3 perfectly good languages trying to get out

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
honestly with the power of implicits scala is arbitrarily many languages trying to get out

gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

i like it when a few pages go by and i don't even understand the class of error being discussed

Same, happens to us all. I don't really follow/care about the actor/general/threading stuff for example, I just write parmap instead of map.

MALE SHOEGAZE posted:

honestly with the power of implicits scala is arbitrarily many languages trying to get out

I'm the consistency of "x shouldBe y" and "x should not be y" ie the most basic scala-test constructs

Luigi Thirty
Apr 30, 2006

Emergency confection port.

https://twitter.com/LuigiThirty/status/899728868772380673

yaaaaaaay I did it it works

akadajet
Sep 14, 2003

Shaggar posted:

scala is for java developers who want to pretend they aren't using java.

shocking that people who have to write in that terrible language desperately look for an escape.

Doom Mathematic
Sep 2, 2008

Nice work! I'm flashing back to my old QBASIC days when I was a kid. I think I gave up just at this point, when I discovered it couldn't do filled polygons.

Shaggar
Apr 26, 2006

akadajet posted:

shocking that people who have to write in that terrible language desperately look for an escape.

java is good. scala is bad and for bad developers who want to use a bad language, but don't want to go through all the headaches of switching to a p-lang

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Doom Mathematic posted:

Nice work! I'm flashing back to my old QBASIC days when I was a kid. I think I gave up just at this point, when I discovered it couldn't do filled polygons.

the Amiga blitter can fill quads if you set it up right but it’s kinda weird, you have to blit the polygon to an empty buffer and then copy it to your display buffer because it just fills from left to right until it hits an on pixel. the fill rate’s pretty high too.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Shaggar posted:

java is good. scala is bad and for bad developers who want to use a bad language, but don't want to go through all the headaches of switching to a p-lang

correct

Brain Candy
May 18, 2006

scala is c++ for the jvm

but worse because people could have known better. java fixed the diamond of death, and as you can see, scala brought it back

Luigi Thirty
Apr 30, 2006

Emergency confection port.

trying to figure out why my camera orientation isn't being applied to my cube right, this is a direct port from my C++ code

code:
VOID GetTransformationMatrixForOrientation( register __a0 Orientation *o, register __a1 Orientation *camera, register __a2 Matrix44 *destination )
{  
    Matrix44 tfCamera;
 
    GetPerspectiveMatrixForOrientation(o, perspective); //(Orientation, Matrix44)
 
    GetTranslationMatrixForOrientation(o, translation);
    GetXRotationMatrixForOrientation(o, xRotation);
    GetYRotationMatrixForOrientation(o, yRotation);
    GetZRotationMatrixForOrientation(o, zRotation);
    GetScaleMatrixForOrientation(o, scale);
   
    /* Camera */
    GetXRotationMatrixForOrientation(camera, camXRotation);
    GetYRotationMatrixForOrientation(camera, camYRotation);
    GetZRotationMatrixForOrientation(camera, camZRotation);
    GetTranslationMatrixForOrientation(camera, camTranslation);
   
    IdentityMatrix44(destination);
   
    MultiplyMatrix44(destination, perspective, destination); //(MatrixL, MatrixR, Out)
   
    /* Camera */
    IdentityMatrix44(&tfCamera);
    MultiplyMatrix44(&tfCamera, translation, &tfCamera);
    MultiplyMatrix44(&tfCamera, xRotation, &tfCamera);
    MultiplyMatrix44(&tfCamera, yRotation, &tfCamera);
    MultiplyMatrix44(&tfCamera, zRotation, &tfCamera);
    MultiplyMatrix44(&tfCamera, scale, &tfCamera);
   
    /* Apply camera translation to the world */
    //MultiplyMatrix44(destination, &tfCamera, destination);
   
    /* World translation */
    MultiplyMatrix44(destination, translation, destination);
   
    /* World rotation */
    MultiplyMatrix44(destination, xRotation, destination);
    MultiplyMatrix44(destination, yRotation, destination);
    MultiplyMatrix44(destination, zRotation, destination);
   
    /* World scale */
    MultiplyMatrix44(destination, scale, destination);
 
}
Identity * Perspective * WorldTranslation * WorldXRotation * WorldYRotation * WorldZRotation * WorldScale transforms the cube correctly.

but throw the camera transformation in and the cube is translated AND rotating AND revolving around the origin??? the cube is at (0,0,0) and the world translation is just (0,0,0) for now too. does CameraTransformation not go between Perspective and WorldTranslation in this setup?

Soricidus
Oct 21, 2010
freedom-hating statist shill

Shaggar posted:

java is good. scala is bad and for bad developers who want to use a bad language, but don't want to go through all the headaches of switching to a p-lang

this. also holds for sbt vs maven. smdh if you see the words "build system that can use the full flexibility of [language] code" and do anything other than run away as fast as you can

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Soricidus posted:

this. also holds for sbt vs maven. smdh if you see the words “build system that can use the full flexibility of [language] code” and do anything other than run away as fast as you can

I can admit there was a time when I would’ve thought "more powerful build system" could only be a good thing. I’ve come around, but I had to learn

Luigi Thirty
Apr 30, 2006

Emergency confection port.

ugh i totally forgot how to implement a rotation matrix for the camera

I have camera translation working but not rotation for some reason

Elysiume
Aug 13, 2009

Alone, she fights.
make a comment on a CR
make the same comment on a CR, link a doc I newly wrote detailing how to do the thing
make the same comment, again, and link to the doc again

:sigh: it's exhausting. doesn't really fit the thread I guess but ugh

Powerful Two-Hander
Mar 10, 2004

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


jfc I'm trying to use the api for this new chat thing and it's documented in yaml that you have to use "swagger" to read which can only be used locally if you have node.js running and install it via docker

like I know that all vendor api docs are terrible but this is wrapping a turd in a second turd made of javascript or something

Powerful Two-Hander
Mar 10, 2004

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


holy gently caress the css file for the Web interface is 1.8mb alongside 8mb of javascript and I think 4mb of fonts

total data received on load:26mb for a glorified irc with no functionality

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Powerful Two-Hander posted:

holy gently caress the css file for the Web interface is 1.8mb alongside 8mb of javascript and I think 4mb of fonts

total data received on load:26mb for a glorified irc with no functionality

Web "development" :razz:

jony neuemonic
Nov 13, 2009

Powerful Two-Hander posted:

jfc I'm trying to use the api for this new chat thing and it's documented in yaml that you have to use "swagger" to read which can only be used locally if you have node.js running and install it via docker

like I know that all vendor api docs are terrible but this is wrapping a turd in a second turd made of javascript or something

swagger, because soap wasn't bad enough the first time around.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Powerful Two-Hander posted:

it's documented in yaml that you have to use "swagger" to read which can only be used locally if you have node.js running and install it via docker

wtf do you mean. swagger is a schema format, not a software tool. that's like saying "it's documented in xml that you have to use wsdl to read"

Powerful Two-Hander
Mar 10, 2004

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


NihilCredo posted:

wtf do you mean. swagger is a schema format, not a software tool. that's like saying "it's documented in xml that you have to use wsdl to read"

it was the swagger.io editor itself. it did work online but pasting 1500 lines of yaml into it caused the browser to go into a bit of a meltdown

anyway I've given up on this now as to use the rest api you have to have a key store service set up to call to to get a session (plus another call to another endpoint to auth it) and there is zero information on whether this actually exists internally or not.

tbh i think if your messaging platform is so complicated that your own docs can't actually explain how to just do a hello world you've probably done something wrong

Adbot
ADBOT LOVES YOU

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
lol the whole point of the Swagger format is so you can deploy documentation real easy, like trivially build out a website of documentation, but instead they just poo poo out the config and tell you you're on your own? just lol.

  • Locked thread