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
Bloody
Mar 3, 2013

Bloody posted:

code:
#define JAVASCRIPT_HEADER                                                     \
    "<script type='text/javascript' language='JavaScript'><!--\n"
#define JAVASCRIPT_FOOTER                                                     \
    "//--></script>\n"
code:
static const uint8_t data_about_htm[] =
{
    /* /about.htm */
    0x2f, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x2e, 0x68,
    0x74, 0x6d, 0x00,
    0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50,
    0x45, 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x3e, 0x0a,
    0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x43, 0x6f, 0x70,
    0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28,
    0x63, 0x29, 0x20, 0x32, 0x30, 0x31, 0x33, 0x2d,
    0x32, 0x30, 0x31, 0x34, 0x20, 0x54, 0x65, 0x78,
    0x61, 0x73, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x72,
    0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x49,
    0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61,
    0x74, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x41, 0x6c,
    0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73,
    0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
    0x64, 0x2e, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x3c,
    0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a, 0x3c, 0x68,
    0x65, 0x61, 0x64, 0x3e, 0x0a, 0x3c, 0x74, 0x69,
    0x74, 0x6c, 0x65, 0x3e, 0x45, 0x4b, 0x2d, 0x54,
    0x4d, 0x34, 0x43, 0x31, 0x32, 0x39, 0x34, 0x58,...

taken from an internet of things eval kit demo software

Adbot
ADBOT LOVES YOU

Deacon of Delicious
Aug 20, 2007

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

Bloody posted:

c on seagulls

seagfaullt

Notorious b.s.d.
Jan 25, 2003

by Reene

CRIP EATIN BREAD posted:

yo yospos, i need a new language. I've been a C programmer for a long time now and i find that i need to write one-off tools and poo poo to process data that's sort of a pain to do a lot of in C. ive used ruby to do some poo poo and while its ok, it loving sucks when it comes to concurrency and robinius or whatever sucks because while it supports threading, its IO is dog slow for whatever reason.

i need something that is relatively fast, has proper concurrency (no global locks), has some sort of notion of iterators or co-routines or whatever, pattern matching and built in regular expressions or whatever for string matching

the fastest things to write one-off tools with are scripting languages: ruby, perl, python. all of them are dog slow and have broken concurrency. usually this does not matter. often i don't really care if my lovely ruby script takes an hour to run, because i'm only gonna run it once

i've sometimes come to use scala for my lovely one-off tools, because then i have an interactive repl like perl/ruby but i can call into java libraries and use fast java i/o and poo poo

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

go fix & go fmt themselves make go stand out from other languages.

gofmt is the only thing i find cool about golang

having a canonical format for code is something so many languages have hosed up. no amount of perltidy is a substitute for a single, definitive method of formatting

dbcooper
Mar 21, 2008
Yams Fan

JewKiller 3000 posted:

come on, perl(1). i said not EVER, for ANYTHING. i expect *.pl to be deleted from my system. DO WHAT I MEAN.

BONGHITZ posted:

only a churl would use perl

Shaggar posted:

all languages that start with p are bad. perl, python, php, ruby, etc... all terrible languages that no one should use irl.

Ok, I'll bite.

Why so much hate for Perl? Or, specifically, why is it a bad fit for CRIP EATIN BREAD's problem space?

Or should I chalk this up to tef's yospos.txt, a short play?

jesus WEP
Oct 17, 2004


HORATIO HORNBLOWER posted:

God is there anything worse in the whole world than trying to untangle javascript spaghetti code

no

no there is not.
there isn't ny other kind ofjavascript code

you start off with good intentions but the whole language is so hosed that you end up with a file full of functions you c&ped from stackoverflow

Notorious b.s.d.
Jan 25, 2003

by Reene

dbcooper posted:

Ok, I'll bite.

Why so much hate for Perl? Or, specifically, why is it a bad fit for CRIP EATIN BREAD's problem space?

Or should I chalk this up to tef's yospos.txt, a short play?

perl concurrency is not as loving broken as python/ruby, but it's still pretty unpleasant.

http://perldoc.perl.org/threads.html#BUGS-AND-LIMITATIONS

there is an entire second threading system called ithreads, which is even buggier and even more broken, but has the advantage that it allows you to get better gc behavior

gonadic io
Feb 16, 2011

>>=

AlsoD posted:

there's still HASKELL

come on, nobody?

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Notorious b.s.d. posted:

the fastest things to write one-off tools with are scripting languages: ruby, perl, python. all of them are dog slow and have broken concurrency. usually this does not matter. often i don't really care if my lovely ruby script takes an hour to run, because i'm only gonna run it once

i've sometimes come to use scala for my lovely one-off tools, because then i have an interactive repl like perl/ruby but i can call into java libraries and use fast java i/o and poo poo

yeah the problem is one of my lovely ruby one offs (take a large data file that is ascii and manipulate it to send to a database) is taking forever, as in a week.

the problem is that parsing the file itself requires a lot of string manipulation (its a horrible format GDF 3.0), that also depends on character counting utf8 characters so writing a parser in C sucks. not to mention parsing out each field requires all sorts of string -> number, etc etc. but ruby not having the ability to pool a set of connections is a huge pain because everything has to be synchronous.

qntm
Jun 17, 2009

dbcooper posted:

Ok, I'll bite.

Why so much hate for Perl? Or, specifically, why is it a bad fit for CRIP EATIN BREAD's problem space?

Or should I chalk this up to tef's yospos.txt, a short play?

PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals

qntm
Jun 17, 2009
Perl is not the fractal of bad design that PHP is, but it's predicated on a handful of really appalling design decisions which manifest themselves in every part of the language, like "context-sensitivity is a good idea", "more things should be implicit", "parentheses generally don't do anything", "weak typing is rad", and TMTOWTDI

Notorious b.s.d.
Jan 25, 2003

by Reene

CRIP EATIN BREAD posted:

yeah the problem is one of my lovely ruby one offs (take a large data file that is ascii and manipulate it to send to a database) is taking forever, as in a week.

the problem is that parsing the file itself requires a lot of string manipulation (its a horrible format GDF 3.0), that also depends on character counting utf8 characters so writing a parser in C sucks. not to mention parsing out each field requires all sorts of string -> number, etc etc. but ruby not having the ability to pool a set of connections is a huge pain because everything has to be synchronous.

it's time to move to scala or groovy or even straight-up java

massively improved string handling (over C)
real parsers and parser generators
easy-peasy connection pooling
concurrency
hella faster than p-langs

qntm
Jun 17, 2009
Perl code:
use strict;
use warnings;

my $string = reverse "hello world";
print $string; # "drlow olleh"

print reverse "hello world"; # "hello world"

qntm fucked around with this message at 20:17 on Dec 3, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene
i kinda/sorta agree with this guy

(but i prefer to use other jvm-based languages rather than straight java all the time)

http://www.teamten.com/lawrence/writings/java-for-everything.html

Notorious b.s.d.
Jan 25, 2003

by Reene
Perl code:
use strict;
use warnings;

my $string = "hello world";

print reverse $string; # "drlow olleh"

print reverse "hello world"; # "hello world"

print scalar reverse "hello world"; # "drlow olleh"
reverse returns a list :smith:

pram
Jun 10, 2001
Perl is not only bad but also dead as awk

triple sulk
Sep 17, 2014



Notorious b.s.d. posted:

gofmt is the only thing i find cool about golang

having a canonical format for code is something so many languages have hosed up. no amount of perltidy is a substitute for a single, definitive method of formatting

A few Scala-based projects I've seen on Github ask to use Scalariform for formatting and it works pretty nicely. IntelliJ helps a lot too by cleaning up unused imports.

qntm
Jun 17, 2009

Notorious b.s.d. posted:

Perl code:
use strict;
use warnings;

my $string = "hello world";

print reverse $string; # "drlow olleh"

print reverse "hello world"; # "hello world"

print scalar reverse "hello world"; # "drlow olleh"
reverse returns a list :smith:

actually I misled you with a typo in my code, it's actually

pre:
use strict;
use warnings;

my $string = "hello world";

print reverse $string; # "hello world"

print reverse "hello world"; # "hello world"

print scalar reverse "hello world"; # "drlow olleh"
reverse reverses a list in list context and reverses a string in scalar context, meanwhile print gives its arguments list context :suicide:

qntm fucked around with this message at 20:19 on Dec 3, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene
list vs scalar context is perl's original sin

MononcQc
May 29, 2007

tef posted:

actually i'd say erlang shines better at distributed systems, not just middleware: for http shunting, or where components have very little interaction between them, then the overhead of erlang's share nothing architecture doesn't really bring much when as is, the daemons are run in pools and share nothing anyway.

For me the big cost of Go comes when you gotta debug and maintain your stack.

Whipping out GDB and inspecting stacks is dumb poo poo that nobody should have to do in TYOL 2014.

tef posted:

unfortunately, erlang's binary and string handling are clumsy
No disagreement on string handling, but on binary handling? Come on. Erlang literally has a data type that lets you do pattern matching on binary patterns with any endianness, integer size, signedness or whatever you want to specify, and can then re-pack things back the same way. Hell, you even have binary comprehensions (aka list comprehensions but using binary pattern matching over arbitrary blobs).

I don't want to ever do bit packing by hand anymore. It's also bullshit nobody should have to do in TYOL 2014.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
alright pram you were right

go is pretty cool. gives me the jvm without having to deal with java's verbosity and structural shortcomings

pram
Jun 10, 2001
Yeah it's epic .. Glad you enjoy it

Bloody
Mar 3, 2013

scala would be cool if it was slightly less terse or better-documented or something. idk.

Bloody
Mar 3, 2013

i guess i don't really know why i would use scala

tef
May 30, 2004

-> some l-system crap ->

CRIP EATIN BREAD posted:

yeah the problem is one of my lovely ruby one offs (take a large data file that is ascii and manipulate it to send to a database) is taking forever, as in a week.

the problem is that parsing the file itself requires a lot of string manipulation (its a horrible format GDF 3.0), that also depends on character counting utf8 characters so writing a parser in C sucks. not to mention parsing out each field requires all sorts of string -> number, etc etc. but ruby not having the ability to pool a set of connections is a huge pain because everything has to be synchronous.

if you used python there would always be pypy and or cython

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

it's time to move to scala or groovy or even straight-up java

massively improved string handling (over C)
real parsers and parser generators
easy-peasy connection pooling
concurrency
hella faster than p-langs

lol sbt

Series DD Funding
Nov 25, 2014

by exmarx
i wish i could decouple go from the heavy runtime though. maybe rust is good for that

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

i guess i don't really know why i would use scala

some people use it because they are fp spergs

i use it as an improved java

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

lol sbt

sbt is a crime.

it enables a few cute use cases but the insides are terrible, writing the project files is hell, and since sbt can only be built with sbt, no linux distributions package it.

Shaggar
Apr 26, 2006

Bloody posted:

i guess i don't really know why i would use scala

scala is so people can use java but pretend they aren't using java. its stupid and worthless. just use java.

Bloody
Mar 3, 2013

Notorious b.s.d. posted:

some people use it because they are fp spergs

i use it as an improved java

Yeah but I use c# as an improved Java already :-/

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

I don't want to ever do bit packing by hand anymore. It's also bullshit nobody should have to do in TYOL 2014.

i'm wrong :shobon:

can't think what i meant by that, i think it was more "the built in strings are bad, and using binaries as a substitute is only a performance improvement"

power botton
Nov 2, 2011

CRIP EATIN BREAD posted:

yeah the problem is one of my lovely ruby one offs (take a large data file that is ascii and manipulate it to send to a database) is taking forever, as in a week.

the problem is that parsing the file itself requires a lot of string manipulation (its a horrible format GDF 3.0), that also depends on character counting utf8 characters so writing a parser in C sucks. not to mention parsing out each field requires all sorts of string -> number, etc etc. but ruby not having the ability to pool a set of connections is a huge pain because everything has to be synchronous.

how large cause im using cython with a few lines of C and processing about 1 tb of gzips a day and shoving it in postgres.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

pram posted:

Perl is not only bad but also dead as awk

I know 3 moderately large companies that are desperate for perl programmers

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

tef posted:

lol sbt

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
I know two companies that invested heavily in scala and both now have draconian "no new scala code" policies in place and have switched over to plain java.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
and I hear twitter is giving up on it too

Notorious b.s.d.
Jan 25, 2003

by Reene
scala lets the architecture astronaut types write code so clever not even they understand it.

which is a pity because the scripting, interactivity, implicit type conversions, and local type inference are all fuckin dynamite additions to java

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

rotor posted:

I know 3 moderately large companies that are desperate for perl programmers

dammit, where were you three months ago when i was trying to find a job? :argh:

Adbot
ADBOT LOVES YOU

Papes
Apr 13, 2010

There's always something at the bottom of the bag.
i don't know anyone who likes scala but i know people who like closure. never used it though but its confusing to try to read.

  • Locked thread