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
Notorious b.s.d.
Jan 25, 2003

by Reene

Bhodi posted:

If have to load a JVM to execute a trivial script you are the worst and every sysadmin hates you forever

loading a jvm takes about a quarter of a second

i have literally used scala scripts for nagios checks

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

triple sulk posted:

this sorta poo poo is the same qualm I kind of have with the new stuff like go or rust (particularly rust). like why the gently caress are you designing a compiled, extremely type safe language that almost all the devs are writing in vim. what the gently caress is the point of having these super fast computers in the year 2015 when you're not taking advantage of something like intellisense (or whatever intellij's analyser is officially called).
golang is broken this way because ken thompson is trapped in the 70s

rust has really great intellisense-type features if you use emacs

triple sulk posted:

I used scala for a little while at my last place as you know and it wasn't the worst thing I've ever used but just IMO it's kinda hosed for the future, even excluding the whole "java 8 has lambdas now" thing

scala has a lot of issues but java 8 containing lambdas ain't one

java 8's lambdas don't improve the type system at all. they're just syntactic sugar for anonymous inner classes. it makes it easier to type and read code using anon inner classes, but that's all.

this is still a good thing, because it allowed sweeping changes to the collections libraries.

it is unfortunate that it doesn't enable very many new use cases for developers

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

@BadAtNetworking posted:

i have literally used scala scripts for nagios checks

Shaggar
Apr 26, 2006

triple sulk posted:

I mean really loving quick scripts and I'm trying to be as nice as possible by saying that, but it's a loving broken mess of a language and is basically the Java of p-langs. the reason I say that is because old as poo poo rails apps are going to be around for another 10-15 years because the sorts of clients who pay for rails apps are too loving lazy or cheap to move off of rails 2 from when it was still an up and coming thing. we dealt with these sorts of clients at the company I was in two jobs ago, and even getting them to move from a then already EoL'd ruby 1.8 to 1.9/2.0 was a loving pain in the rear end.

actually its easier to just fire up visual studio and make a console app that does the same thing but then can also be run everywhere without the need to install ruby.

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug
Scala scripts for nagios checks? Well you just gave me a good cry, so thanks for that. Though the comedic value of leveraging nagios parallelization and then hitting out of memory errors because you spawned a dozen separate JVMs probably makes up for it.

Notorious b.s.d.
Jan 25, 2003

by Reene
people talk about loading a jvm like it's some kind of ridiculous operation

fun fact: running "java -version" loads an entire jvm. turns out my quarter second estimate was like, 3x as long as it actually takes.

code:
$ time java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
	
real    0m0.083s
user    0m0.080s
sys     0m0.012s

Shaggar
Apr 26, 2006

Notorious b.s.d. posted:

i don't really like groovy but i prefer to point out that groovy and scala both exist. hating scala doesn't mean you have to spend time with a terrible p-lang for your one-off scripts.

groovy is as close to java as you can get while retaining the ability to write quick dirty code and run it like a shell script

groovy is better than scala because it doesn't pretend to not be java

Notorious b.s.d.
Jan 25, 2003

by Reene

Bhodi posted:

Scala scripts for nagios checks? Well you just gave me a good cry, so thanks for that. Though the comedic value of leveraging nagios parallelization and then hitting out of memory errors because you spawned a dozen separate JVMs probably makes up for it.

java's peak memory consumption is going to be lower than your p-lang check

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Shaggar posted:

groovy is better than scala because it doesn't pretend to not be java

i thought scala was just "java with improvements" :confused:

JawnV6
Jul 4, 2004

So hot ...
80ms is "instant" to a human

i use c# when i need to put a button on a windows machine, switched to python for all my terrible web-facing stuff

Notorious b.s.d.
Jan 25, 2003

by Reene
you cannot simultaneously hate on java and defend p-langs.

if you're not writing your nagios checks in pure C (loading a C++ runtime can quickly bloat you to java levels) then arguing against nagios checks on the jvm is nuts

Notorious b.s.d. fucked around with this message at 19:25 on Feb 3, 2015

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug
I've heard java called a lot of things but memory efficient hasn't ever been one of them. Maybe i'm going out on a limb here but no loving way. I think you just see java as a hammer and every computer ever as a gigantic nail.

Notorious b.s.d.
Jan 25, 2003

by Reene

prefect posted:

i thought scala was just "java with improvements" :confused:

groovy is an almost-entirely clean superset of java. you can feed java code to a groovy interpreter and it will work.

scala is an entirely separate language with extremely good java interop. it is not a superset. (although scalac can read java code, it passes it to the java compiler internally)

Notorious b.s.d.
Jan 25, 2003

by Reene

Bhodi posted:

I've heard java called a lot of things but memory efficient hasn't ever been one of them. Maybe i'm going out on a limb here but no loving way. I think you just see java as a hammer and every computer ever as a gigantic nail.

verify for yourself. 'time -v $COMMAND' will print basic memory usage stats for the command.

p-langs can be astonishingly wasteful with memory. even trivial poo poo, like nagios checks, can eat tens of megs. java is loving svelte compared to perl/ruby/python

Shaggar
Apr 26, 2006
irrational java hatred esp wrt memory usage is another great way to detect people who have no idea what they're talking about and/or are still stuck in the 70s. not surprisingly most of these people use a Linux and plangs.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Notorious b.s.d. posted:

groovy is an almost-entirely clean superset of java. you can feed java code to a groovy interpreter and it will work.

scala is an entirely separate language with extremely good java interop. it is not a superset. (although scalac can read java code, it passes it to the java compiler internally)

has groovy gotten grape working right? every time i tried to use it (last year), it would fail to actually work at downloading the jars i told it to get

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Shaggar posted:

irrational java hatred esp wrt memory usage is another great way to detect people who have no idea what they're talking about and/or are still stuck in the 70s. not surprisingly most of these people use a Linux and plangs.

i worked at a company where they were making java desktop apps that could also load as applets in the '90s, and it scarred me for life

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
i use clojure :frogbon:


its like java, but better

Notorious b.s.d.
Jan 25, 2003

by Reene
ruby 2.1.2 takes 9 megabytes of memory and 1335 page faults to print "hello world"
code:
        Command being timed: "ruby -e print "hello world\n""
        User time (seconds): 0.04
        System time (seconds): 0.00
        Percent of CPU this job got: 98%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.05
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 9316
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 1335
        Voluntary context switches: 3
        Involuntary context switches: 3
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug
haha that's pretty bad.

I fully admit most of my java experience was with a specific app that ran very close to the machine overhead. We ran into all sorts of problems, like trying to hook in optier for profiling and it crashing the system.

Of course it was probably just the app; It's performance was so lovely we had to run a custom SAP JRE that tweaked the garbage collection otherwise the entire thing would hang for 3-4 seconds while it scooped up god knows what.

But it was me who was responsible for deploying and maintaining the mess, and making it all work, I pretty much saw tracebacks in my sleep for months. I'm pretty sure it biased me against anything java forever.

Notorious b.s.d.
Jan 25, 2003

by Reene

prefect posted:

has groovy gotten grape working right? every time i tried to use it (last year), it would fail to actually work at downloading the jars i told it to get

i have only ever used groovy for scripts, so i wouldn't know.

i don't like groovy that much. i use it because i have to (jenkins practically requires it)

triple sulk
Sep 17, 2014



http://blogs.msdn.com/b/dotnet/archive/2015/02/03/coreclr-is-now-open-source.aspx

How appropriate

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Notorious b.s.d. posted:

i have only ever used groovy for scripts, so i have nfc

you can use grape in scripts -- the idea is that it magically does maven/gradle-type library loading for you

Notorious b.s.d.
Jan 25, 2003

by Reene

Bhodi posted:

haha that's pretty bad.

I fully admit most of my java experience was with a specific app that ran very close to the machine overhead. We ran into all sorts of problems, like trying to hook in optier for profiling and it crashing the system.

Of course it was probably just the app; It's performance was so lovely we had to run a custom SAP JRE that tweaked the garbage collection otherwise the entire thing would hang for 3-4 seconds while it scooped up god knows what.

But it was me who was responsible for deploying and maintaining the mess, and making it all work, I pretty much saw tracebacks in my sleep for months. I'm pretty sure it biased me against anything java forever.

garbage collection nightmares are still common in p-langs, but if you run into them, you're just hosed

you don't have any tunables.
you don't have jmx.
you don't have any metrics.

people look at all the annoying poo poo you can do with java, and assume that java must be bad. no, the truth is, you just can't do those unpleasant things at all in your terrible scripting language.

p.s. if you are tuning garbage collection you are probably pretty hosed

Notorious b.s.d.
Jan 25, 2003

by Reene

prefect posted:

you can use grape in scripts -- the idea is that it magically does maven/gradle-type library loading for you

this is not a feature i would ever want in a million years, oh god that sounds terrible

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug

Notorious b.s.d. posted:

people look at all the annoying poo poo you can do with java, and assume that java must be bad. no, the truth is, you just can't do those unpleasant things at all in your terrible scripting language.
You know what maybe it's time to become a fan of restrictive languages because otherwise it's like giving a pistol to a toddler

Notorious b.s.d.
Jan 25, 2003

by Reene

Bhodi posted:

You know what maybe it's time to become a fan of restrictive languages because otherwise it's like giving a pistol to a toddler

i was talking about tuning the runtime

in terms of blowing your foot with your code, java's pretty good about not having pointy bits to poke your eye out

MononcQc
May 29, 2007

The language is the tool idiots use to implement their idiot systems. A more restrictive language either means your idiots will find new compelling idiotic ways to do things or won't use your tool in the first place because it doesn't let them be idiots.

Otherwise we'd have moved to some 5th gen language that automates a bunch of poo poo and restricts you in using typechecked dataflow CRDTs with constraint solving so nobody makes an error, but clearly that's not the way it's headed. Let's debate whether you truly need generics some more.

Bloody
Mar 3, 2013

i use c because my other option is assembly

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
i use goatlang. it's c with the compiler modified such that it displays hello.jpg (or ascii art thereof) whenever it encounters ub

triple sulk
Sep 17, 2014



https://github.com/dotnet/coreclr/tree/master/src/mscorlib/src/System

:yum:

Notorious b.s.d.
Jan 25, 2003

by Reene

MononcQc posted:

Otherwise we'd have moved to some 5th gen language that automates a bunch of poo poo and restricts you in using typechecked dataflow CRDTs with constraint solving so nobody makes an error, but clearly that's not the way it's headed. Let's debate whether you truly need generics some more.

sparkada exists

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

Bloody posted:

i use c because my other option is assembly

c/c++ so I don't have to do fortran

MononcQc
May 29, 2007

Notorious b.s.d. posted:

sparkada exists

"won't use your tool in the first place because it doesn't let them be idiots."

Soricidus
Oct 21, 2010
freedom-hating statist shill

Bhodi posted:

I've heard java called a lot of things but memory efficient hasn't ever been one of them. Maybe i'm going out on a limb here but no loving way. I think you just see java as a hammer and every computer ever as a gigantic nail.

context is important. all those people who complain that Java is slow and bloated? they are comparing it to carefully-tuned C, not to plangs.

in my experience, pulling figures out of my rear end, Java is generally roughly half the speed of C, and has a memory overhead of maybe 4-8x. for plangs, that becomes 10-100x worse in both dimensions.

I still often use plangs where speed and memory don't matter, and c when both are critical, but there's a lot of middle ground where Java is the best compromise by far.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Tiny Bug Child posted:

it is. the more you use json the more you notice how bad it sucks, especially because now that the useless academics are starting to use json, you're seeing a lot more json parsers adhere to asinine levels of "strictness" (to a spec that doesn't really exist). this leads directly to dumb poo poo like you quoted. they really hosed up php's json encoder/parser a couple minor versions ago; now it breaks if you try to parse json that doesn't double-quote the key names. thanks douglas crockford, that really helps.

i have a draft blog post somewhere that outlines my idea for a replacement for json: PAN, or PHP array notation. just like you can eval() json to get a javascript object, you can eval() a chunk of PHP and get a PHP array. it's a great idea because php even has the encoder built in: var_export(). there's really no reason not to use it over json. also, the spec for PAN is eternally frozen at "any php code that evaluates to an array" because deviating from that is where JSON started to turn to poo poo

serialize is better because it supports object instances

Bloody
Mar 3, 2013

Soricidus posted:

context is important. all those people who complain that Java is slow and bloated? they are comparing it to carefully-tuned C, not to plangs.

in my experience, pulling figures out of my rear end, Java is generally roughly half the speed of C, and has a memory overhead of maybe 4-8x. for plangs, that becomes 10-100x worse in both dimensions.

I still often use plangs where speed and memory don't matter, and c when both are critical, but there's a lot of middle ground where Java is the best compromise by far.

to steal someone else's table
pre:
	
		Fortran	Julia	Python	R	Matlab	Octave	Mathe-matica	JavaScript	Go	LuaJIT	Java
fib		0.70	2.39	79.95	553.57	4638.29	9764.56	163.43		3.73		2.14	2.38	0.90
parse_int	4.88	1.93	12.24	53.23	1580.52	9106.83	17.66		2.33		3.77	6.79	5.55
quicksort	1.31	1.24	33.23	255.73	54.43	1766.13	48.21		2.91		1.11	2.36	1.69
mandel		0.74	0.72	12.18	54.06	51.23	391.25	6.24		1.55		0.99	0.71	0.57
pi_sum		0.99	1.06	16.93	16.55	1.27	279.53	1.51		2.19		1.33	1.18	1.00
rand_mat_stat	1.15	2.14	19.04	16.65	10.48	35.92	6.71		3.32		8.92	4.34	4.01
rand_mat_mul	4.73	1.11	1.24	1.91	1.18	1.25	1.21		17.19		9.83	1.44	2.35

from http://julialang.org/ benchmark times relative to C (smaller is better, C performance = 1.0).
so yeah java is pretty performant and a lot of plangs are better than you might expect

Bloody
Mar 3, 2013

i know i know language benchmarks are generally dumb and bad

fritz
Jul 26, 2003

Notorious b.s.d. posted:

golang is broken this way because ken thompson is trapped in the 70s

see also stallman and that gcc/emacs drama from last month about the AST

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

fritz posted:

see also stallman and that gcc/emacs drama from last month about the AST

i wish stallman was trapped in the 70s, but unfortunately he has escaped and walks among us

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