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


this is not a desirable feature

Adbot
ADBOT LOVES YOU

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

MononcQc posted:

Options/configs for something. Imagine that instead of going with binary flags you can pass in [read, write, {encoding, "utf-8"}, {buffer, Size::Int, Delay::Int}] as a list of config options. Makes for readable stuff.

It's nice because you can use similar stuff for TCP sockets like [raw, keep_alive, whatever] and merge that list with SSL options like [{private_key, "some data"}, {cipher_suites, ["AES-...", "ECDHA-..."]}, {sni_hostname, "example.org"}, ...] and have it work together. I guess you would enumerate all the possible combinations in your type signature if you really wanted to, you're just not forced to do it in a dynamic lang.

A couple pages late, but you can do this in Haskell with GADTs.

code:
data OptName a where
  Read :: OptionName Bool
  Write :: OptionName Bool
  Encoding :: OptionName String
  Buffer :: OptionName (Int, Int)
  -- ...

infixl 1 :=

data Option where
  (:=) :: OptName a -> a -> Option

opts :: [Option]
opts = [Read := True, Write := False, Encoding := "utf-8", Buffer := (32768, 100)] -- and so on.
You can probably make a better type for storing the options than a list.

If you really want to be able to specify names at run-time, I think there are ways to do that as well, using open coproducts, but that's a type of magic even I don't understand yet.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Bloody posted:

this is not a desirable feature

you say that now, but in two week you suddenly get a feature request where you must get the value of a coordinate in the mandelbrot set from the database

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Cybernetic Vermin posted:

sql is poo poo and old-school databases are poo poo but databases in general and query languages with some sound logical basis are good fun to work with

yeah its fun to gently caress around and be like "gimme the top 5 idiots who bought our worst product" or some poo poo

sarehu
Apr 20, 2007

(call/cc call/cc)
I just learned today that Nim ignores n-dash characters in identifiers too. Which is doubleplusbad because it's the m-dash that should be used without spaces.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Bloody posted:

i dont doubt that postgres contains chronic traumatic encephalopathy

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Zemyla posted:

A couple pages late, but you can do this in Haskell with GADTs.

code:
data OptName a where
  Read :: OptionName Bool
  Write :: OptionName Bool
  Encoding :: OptionName String
  Buffer :: OptionName (Int, Int)
  -- ...

infixl 1 :=

data Option where
  (:=) :: OptName a -> a -> Option

opts :: [Option]
opts = [Read := True, Write := False, Encoding := "utf-8", Buffer := (32768, 100)] -- and so on.
You can probably make a better type for storing the options than a list.

If you really want to be able to specify names at run-time, I think there are ways to do that as well, using open coproducts, but that's a type of magic even I don't understand yet.
isn't coproduct latin for rear end in a top hat

Sapozhnik
Jan 2, 2005

Nap Ghost
Kopros is Greek you pleb

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

hipster database programming is just doing manual joins in ruby on a non-performant object store with no transactional guarantees

same

tef
May 30, 2004

-> some l-system crap ->

suffix posted:

is there a hipster relational query language that is like sql but good?

no, because what plain SQL is good for is for interoperability, or "please dear god i don't want to write any more analytics or reporting by hand, from scratch"


quote:

i've been hitting cases of things that should be easy but turns out to require bolt-on-feature x that is only supported in some random 25% of sql servers

someone must have made something based more on relational algebra and less on cobol

they did, postgres, and then they dropped quel and added sql to get postgresql

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

what does postgres even mean

Cybernetic Vermin
Apr 18, 2005

post-ingres

there is little reason to remember ingres since it is like postgres except even worse

Sapozhnik
Jan 2, 2005

Nap Ghost
postgres is fine

Bloody
Mar 3, 2013

it refers to life after taking the GREs

VikingofRock
Aug 24, 2008




Bloody posted:

it refers to life after taking the GREs

Oh god is postgres like grad school?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
so mongo is a postged db?

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

postgood maybe

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

VikingofRock posted:

Oh god is postgres like grad school?

they own wired tiger now so they bought themselves some "credibility"

misquote this was for mongo

Sweeper fucked around with this message at 06:11 on Jun 22, 2016

jony neuemonic
Nov 13, 2009

are we talking about postgres?

it's good. pretty good, even.

Breakfast All Day
Oct 21, 2004

postgres may be the least bad piece of software to ever exist

its still bad

Sapozhnik
Jan 2, 2005

Nap Ghost
i mean its execution engine isn't as good as Oracle's but if you get to the point where you need a single monster database server for your business then you should maybe think about scaling out instead if possible idk

i'd put up with a whole bunch of bullshit just to make sure i do not become yet another one of larry's multitudinous bitches

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

jony neuemonic posted:

are we talking about postgres?

it's good. pretty good, even.

isn't pretty good < good? :confused:

mystes
May 31, 2006

Wheany posted:

isn't pretty good < good? :confused:
I think they're actually equal in JavaScript.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

mystes posted:

I think they're actually equal in JavaScript.

tef
May 30, 2004

-> some l-system crap ->

Breakfast All Day posted:

postgres may be the least bad piece of software to ever exist

its still bad

postgres 8 was awful

postgres 9 is better

postgres shows that after what 30-40 years you can get there



pandoc, sqlite otoh, miracles

redleader
Aug 18, 2005

Engage according to operational parameters

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'


wat

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

mystes posted:

I think they're actually equal in JavaScript.

:golfclap:

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang




:pwn:

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

duh, typeof null isn't undefined the first 4099 times you test for it. after that it is.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

is that like, deterministic on your machine, flipping at the same number of iterations? lol if it is, double lol if it happens on other machines exactly the same too.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



lol on this machine it goes

code:
for (let i = 0; i < 10000; ++i) {
	console.log(typeof null === 'undefined');
}
4917 false
5083 true
every time

if you remove the "let", its 10000 false every time.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

the gently caress is even happening with that

Jerry Bindle
May 16, 2003
4917 - false
5083 - true

on my mba lol

Jerry Bindle
May 16, 2003
is the let syntax valid? safari wouldn't take it

Bloody
Mar 3, 2013


wtf

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
you know when people say that JavaScript is getting better all the time, what they're actually saying is the transpilers are. implementations of JavaScript aren't moving that fast at all. what in gods name is that let declaration doing to the scope of those brackets to bring that out of the VM?

Cybernetic Vermin
Apr 18, 2005

i'd assume it is an optimizer bug and the optimizer doesn't get triggered until the code has run ~5000 times

abraham linksys
Sep 6, 2010

:darksouls:
it's a v8 JIT bug in Chrome, there's a V8 bugfix (https://github.com/v8/v8/commit/7dfb5beeec8821521beeb2b8eac36707a663064c) and it's fixed in Canary, dunno if they'll patch stable/beta channel or what

Adbot
ADBOT LOVES YOU

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

mystes posted:

I think they're actually equal in JavaScript.

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