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
tef
May 30, 2004

-> some l-system crap ->
x y problem strikes again

Adbot
ADBOT LOVES YOU

1337JiveTurkey
Feb 17, 2005

rotor posted:

yeah, but you know, baby steps.

you gotta admit that we've got the constantly observing our lives bit down pat and we're pretty good at using that information to make someone else's life easier. the rest is just bikeshedding

coaxmetal
Oct 21, 2010

I flamed me own dad
gonna rebutt some of this cuz im bored

Zombywuf posted:

* this:
code:
>>> x = []
>>> y = x
>>> x += [1]
>>> y
[1]
>>> x = ()
>>> y = x
>>> x += (1,)
>>> y
()
not sure what the problem is here, tuples are immutable and lists aren't, so that seems like normal behavior. Or are you confused by assigning by reference?

x is a list, then y is assigned to be the same list, then you concatenate [1] onto the list, and y is that, like you would expect. if you make x a tuple, thats immutable, so y is assigned to that same tuple, but if you change the tuple that x is assigned to, y doesn't get pointed to the new tuple.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
see perl conveniently pre-flattens all your poo poo so we dont ever have to worry about this

besides, tuple is a terrible world


e: keeping freudian typo

FamDav
Mar 29, 2008

Ronald Raiden posted:

gonna rebutt some of this cuz im bored

not sure what the problem is here, tuples are immutable and lists aren't, so that seems like normal behavior. Or are you confused by assigning by reference?

x is a list, then y is assigned to be the same list, then you concatenate [1] onto the list, and y is that, like you would expect. if you make x a tuple, thats immutable, so y is assigned to that same tuple, but if you change the tuple that x is assigned to, y doesn't get pointed to the new tuple.

Show him the gift boxes.

Sneaking Mission
Nov 11, 2008

tef posted:

x y problem strikes again

xx problem

Toady
Jan 12, 2009

rotor posted:

I think we have enough languages, what we need now is a program to write other programs for us because we're super bad at it.

what if WE are the programS??

Deacon of Delicious
Aug 20, 2007

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

Toady posted:

what if WE are the programS??

the world and everyone it is awful, so we were all written in p languages and are running on a linux

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

Toady posted:

what if WE are the programS??

naw.

tef
May 30, 2004

-> some l-system crap ->
http://web.archive.org/web/20110726002019/http://diveintomark.org/archives/2004/02/04/incompatible-rss heh

Shaggar
Apr 26, 2006
lol netscape.

JawnV6
Jul 4, 2004

So hot ...

rotor posted:

I think we have enough languages, what we need now is a program to write other programs for us because we're super bad at it.
perl is p. good for this

Catalyst-proof
May 11, 2011

better waste some time with you

JawnV6 posted:

lisp is p. good for this

Zombywuf
Mar 29, 2008

Ronald Raiden posted:

gonna rebutt some of this cuz im bored

not sure what the problem is here, tuples are immutable and lists aren't, so that seems like normal behavior. Or are you confused by assigning by reference?

x is a list, then y is assigned to be the same list, then you concatenate [1] onto the list, and y is that, like you would expect. if you make x a tuple, thats immutable, so y is assigned to that same tuple, but if you change the tuple that x is assigned to, y doesn't get pointed to the new tuple.

You have correctly identified all the lines that do not do bad things. The line which does the bad thing is this one:
code:
>>> x += (1,)
This should throw.

Zombywuf
Mar 29, 2008

Jonnty posted:

clearly the solution is computers which constantly observe us and create programs to make our lives easier and more efficient automatically

We just need to make a program to write programs then tell it to write a better program writing program. Repeat this a few times then make it write a time travel program that sends itself back in time to just before we write the first program writing program.

Development solved. You're all going to have to get new jobs.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Zombywuf posted:

We just need to make a program to write programs then tell it to write a better program writing program. Repeat this a few times then make it write a time travel program that sends itself back in time to just before we write the first program writing program.

Development solved. You're all going to have to get new jobs.

I'm sure Skynet will be able to find new things for us to do.

tef
May 30, 2004

-> some l-system crap ->
work from home earn $$$

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

work from home earn $$$

spam and prevention of are the cutting-edge of ai research, think about that

every false-positive and false-negative a failed turing test with you as the human control input

Workaday Wizard
Oct 23, 2009

by Pragmatica

prefect posted:

I'm sure Skynet will be able to find new things for us to do.

7 Scientific Reasons a Skynet Rising Would Fail (Quickly) | Cracked.com

tef
May 30, 2004

-> some l-system crap ->

Cocoa Crispies posted:

spam and prevention of are the cutting-edge of ai research, think about that

there is a lot of work on text classification, the cutting edge of ai is a lot broader.

(especially with work on statistical nlp, translation especially)

quote:

every false-positive and false-negative a failed turing test with you as the human control input

i once wrote a bot that said 'heh' every 30s and left it running on my irc session.

no-one noticed for a while. someone thought I was doing it on purpose and tried to keep up.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

eight reasons we're using an ai to write our dumb and epic fail cookie cutter articles | cracked.com

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
such epic fail

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

0xB16B00B5 posted:

such epic fail

*built a markov chain out of "please respond" posts*

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
criticize my stupid idea please

so for doing types you add a class to a type set, so Integer would be in the set number or something, and you could query the set for other types or objects.

example: you wanted all the types that were real numbers, so querying the number set would return Integer, Fraction, Irrational, whatever

i feel like this is just basically subclassing, but for some reason it feels different idk help me yospos. i also dont know why this would be useful either

edit: also you do perform set operations and stuff obviously, union, intersection, etc

also each type-set keeps track of its members

gonadic io
Feb 16, 2011

>>=
code:
Haskell> :i Num
class Num a where
  (+) :: a -> a -> a
  (*) :: a -> a -> a
  (-) :: a -> a -> a
  negate :: a -> a
  abs :: a -> a
  signum :: a -> a
  fromInteger :: Integer -> a
        -- Defined in `GHC.Num'
instance Num Integer -- Defined in `GHC.Num'
instance Num Int -- Defined in `GHC.Num'
instance Num Float -- Defined in `GHC.Float'
instance Num Double -- Defined in `GHC.Float'

Max Facetime
Apr 18, 2009

that's maths but without all the number crunching that's got useful applications in the real world

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Sweeper posted:

i feel like this is just basically subclassing

it is

Sweeper posted:

edit: also you do perform set operations and stuff obviously, union, intersection, etc

where would the ability to perform this on types be useful

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

Tiny Bug Child posted:

it is


where would the ability to perform this on types be useful

idk i have thought about it that much yet

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

AlsoD posted:

code:
Haskell> :i Num
class Num a where
  (+) :: a -> a -> a
  (*) :: a -> a -> a
  (-) :: a -> a -> a
  negate :: a -> a
  abs :: a -> a
  signum :: a -> a
  fromInteger :: Integer -> a
        -- Defined in `GHC.Num'
instance Num Integer -- Defined in `GHC.Num'
instance Num Int -- Defined in `GHC.Num'
instance Num Float -- Defined in `GHC.Float'
instance Num Double -- Defined in `GHC.Float'

ive been meaning to play with haskell but i have no problem to solve with it so i havent

it looks neat

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
what if you could have an infinite set of types im just postin here not thinkin

tef
May 30, 2004

-> some l-system crap ->
:2bong: z0rgohistomorphic prepromorphisms

Nomnom Cookie
Aug 30, 2009



What if, like, the types are the program

We'd never have to write code again

Opinion Haver
Apr 9, 2007

Zombywuf posted:

You have correctly identified all the lines that do not do bad things. The line which does the bad thing is this one:
code:
>>> x += (1,)
This should throw.

why, it's equivalent to x = x + (1,)

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
+= with a tuple is fine, it makes perfect sense

what isn't ideal is

Python code:
>>> x = [1]
>>> y = x
>>> x += [2]
>>> x
[1, 2]
>>> y
[1, 2]
Python code:
>>> x = [1]
>>> y = x
>>> x = x + [2]
>>> x
[1, 2]
>>> y
[1]
list.__iadd__ just calls list.extend and then returns self, list.__add__ has to return a new object. the += is still assigning something to x, but its the same object in this case

Python code:
>>> from dis import dis
>>> dis(compile('x = []; x += [1]', '', 'exec'))
  1           0 BUILD_LIST               0 
              3 STORE_NAME               0 (x) 
              6 LOAD_NAME                0 (x) 
              9 LOAD_CONST               0 (1) 
             12 BUILD_LIST               1 
             15 INPLACE_ADD
             16 STORE_NAME               0 (x) 
             19 LOAD_CONST               1 (None) 
             22 RETURN_VALUE
>>> dis(compile('x = []; x = x + [1]', '', 'exec'))
  1           0 BUILD_LIST               0 
              3 STORE_NAME               0 (x) 
              6 LOAD_NAME                0 (x) 
              9 LOAD_CONST               0 (1) 
             12 BUILD_LIST               1 
             15 BINARY_ADD
             16 STORE_NAME               0 (x) 
             19 LOAD_CONST               1 (None) 
             22 RETURN_VALUE

Opinion Haver
Apr 9, 2007

the real answer here is that you should use immutable data structures for everything and not have to worry about this poo poo

fritz
Jul 26, 2003

Cocoa Crispies posted:

spam and prevention of are the cutting-edge of ai research, think about that

every false-positive and false-negative a failed turing test with you as the human control input

yes i too read that charles stross novel

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
lol if you read

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

yaoi prophet posted:

the real answer here is that you should use immutable data structures for everything and not have to worry about this poo poo

now you have 32767 problems

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
look jsut loving decide what X is already stop changing your mind later int he program

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

immutable data structures are pretty nice to have but also getting well-delimited mutability is a nice tool. I do prefer a clear delimitation between both modes than only mutable if available though.

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