« first day (34 days earlier)      last day (3153 days later) » 
08:00 - 14:0014:00 - 00:00

8:20 AM
anyone around? I wanted to put a link to the question "What is the difference between freeware and free software?" in my answer to opensource.stackexchange.com/questions/1365/… , but that question doesn't exist. Asking it would be an effective duplicate of opensource.stackexchange.com/questions/1365/…
what do you guys think? Asking the question, and closing as a duplicate? Or editing the question it is an effective duplicate of. They are slightly different in terminology, but the answers apply equally well to both
The new question title would be short and sweet and to the point for newcomers though, and easy to find
And as a second note (and expressly pinging @Gilles due to the experience in cross-SE work), I just asked a question on law: law.stackexchange.com/questions/1410/… that is also interesting for here. Would it be a good idea to reach out on them on meta to discuss the limits of their on/off topic and our on/off topic, and how we can mutually benefit from each others off-topic questions?
 
8:36 AM
@Martijn That second link doesn't seem right
 
as for your question, asking and closing as a dupe seems helpful
but I'm not sure if it's the right thing to do
I'm not 100% sure if it would actually be a dupe by the way
I mean, the question is about language isn't it?
 
I'll just ask the question, and see what happens with close votes
 
free as in beer and free as in speech is more of an answer "What is the difference between freeware and free software?" than it is a duplicate question
 
power to the community \o/
 
8:40 AM
I think it'll be good to have it out there
whether it gets closed or not
 
Feel free to edit the question by the way. It's no longer possible to mark your own question community wiki, but it is my intent. Right now it's very short, but I don't know if/how making it longer will make it clearer
 
I don't think adding fluff would help in this case
funnily, your question is answered by the wikis of the two tags you applied to it :)
@Martijn what linked question?
 
already edited :P
 
 
1 hour later…
9:58 AM
I'm on a question-roll today
 
10:24 AM
@Martijn I'm glad to see it
 
Hey!!!
 
@Zizouz212 Hi
 
What's happened?
I hear we are trying to get into contact with law on scope boundaries?
 
@Zizouz212 Martijn asked a few questions :)
 
I noticed :)
 
10:29 AM
@Zizouz212 I read something to that effect, yes
Not sure about details though
I forgot what I read again
 
@Zizouz212 I was just asking here in chat if we should. I think it would be nice if law does at least know we exist and what our scope is, and that we welcome questions that are in it, but not a good fit for them
 
@Martijn I would approve of some sort of cooperation between the two sites
I wonder where/how to address it though
 
And also if there are any questions that are out of scope here, but might be in scope there, if they want us to send them that-a-way
 
They need to make an app for SE chat...
 
@Zizouz212 They do have an API...
 
10:34 AM
About that, I can see if I can chat with them...
@overactor I don't know how to write apple apps... Like stuff for iPhone
 
@Zizouz212 developing for apple costs money
 
What?
 
AFAIK the chat API is undocumented
 
Wait... I need to pay to make an app for iPhone?
 
and unofficial/reverse engineered
@Zizouz212 pretty much, yeah
you need a developers license
 
10:36 AM
100 dollars per year
 
I think they cost $100 per year
 
A developers license?
What the hell? 100 a year?
Screw apple and their stupid apple dev stuff...
But why would they charge 100 a year?
 
I'm not sure at which point you need the license
with android though:
 
you need a license when you want to publish to the appstore
 
download plugin for eclipse or intellij android studio
free
distribute apk's: free
 
10:38 AM
Alright, but then how do I just put it onto my phone, without going to the App Store?
 
by rooting your phone and side-loading
 
publish on play store: 25 dollar one time
 
What languages can go on android?
 
any JVM
 
You mean java?!?
 
10:39 AM
It should be mentioned, you can also use html5 + js and a webview
 
so Java, Scala, Jython, Clojure etc. etc.
 
(I am the happiest man in the world!!!)
 
make a test application. DO EEEET
 
I must say though, swift is a fun language
 
from what I've seen of it, it seems OK'ish
 
10:43 AM
@Martijn any gripes?
 
I always have gripes :P
 
@Martijn care to express those gripes?
 
I know the language for iOS is swift, it looks pretty neat
 
I like it
 
no higher kinded types for example
 
10:44 AM
decent functional programming (I think)
inferred typing
safe
 
OOP through inheritance (which I think is a mistake)
 
clean syntax (mostly)
 
Smart people...
Can we do this for all languages? Python!
 
@Martijn What is your problem with inheritance exactly?
 
I kind of like pop :)
 
10:46 AM
@Zizouz212 I'm mostly talking out of my arse really
 
It's extremely rare to be useful
 
I mean, I mean what I say
but I don't consider myself experienced enough for my opinions to hold any significant value to them
 
and it's often surprising or confusing
 
@Martijn What is meant by that?
Does that relate to functions that return functions as a type?
Int -> Int -> Int ?
Or do you need one step further?
 
higher kinded types?
 
10:50 AM
@Martijn yes
 
no, that's an example of a higher order function (a function that takes an int, and returns a function)
if you have a list, you have a list of something, for example a list of ints
the int is called a type parameter
 
All obvious so far
 
you could imagine some other interface (which doesn't exist in java or swift for example), that has a type parameter that is constrained to have some(unspecified) type parameter itself
that's roughly a higher kinded type
 
How does this differ from 'Type' being a type itself?
 
eh
 
10:54 AM
Geez...
 
I'm reading up on it
 
what's a strongly typed language you're comfortable with?
 
Python :)
 
strongly typed
 
Java is fine
 
10:55 AM
Java
 
I might name some methods or classes wrong, but the idea should be here
let's take List<A>
 
Where A is a Type, gotcha
 
that has a method map, that takes a function A => B (this is not valid Java, but you get the point)
 
yeah
takes type A as input, returns type B
 
so you have interface List<A> { public List<B> map<B>(A => B projection) }
you can do the operation map over List
but there are many things you can do the equivalent over
for example interface HashMap<A, B> { public HashSet<A, C> map<C>(B => C projection) }
so there is this whole class of mappable things, that all follow the same pattern
and we want to call that something, describe it in code
 
11:01 AM
We're assuming that the logic of the mapping is similar in these cases?
 
the logic is different for each one, but the type is the same
for the example I'm headed at, there are some constraints, but pretend there are none for now
I have a nice side-step in a moment, but that's in a moment
 
Shouldn't your second example be different then?
 
yeah, slightly, I couldn't quickly think of another familiar mappable thing
Futures are a better example, as are Options
but I don't know if you're familiar with either
 
well, my problem lies mainly with (B => C)
 
oh, it's just letters
 
11:05 AM
I suppose my question is then, what exactly is similar between your two examples?
That we are applying a function that maps one type onto another on a collection of some type to get a collection of another type?
 
oh
I mistyped
interface HashMap<A, B> { public HashMap<A, C> map<C>(B => C projection) }
does that make more sense?
or is the two type parameters still confusing
 
Two type parameter is no problem.
 
let's make it interface Wobble<A> { public Wobble<B> map<B>(A=>B projection); }
so you have a map function that if you give it a something<A> it gives a something<B>
 
I feel like I'm missing something, but maybe that comes later
I get all of your example in isolation
 
there
there is also ArrayList
 
11:10 AM
I see the similarity between them
 
that could also have a map function
unfortunately, there is no way to express the similarity in Java
what you would want is something like this
 
By the way, is A a specific type or a generic?
 
it's generic
 
OOH
ok
 
interface Mappable<F<?>> { public F<A> map<A, B>(F<A> src, A=>B projection) }
so than you have an interface with a map function, and if you give it some kind of whatever<A>, and a function A=>B, it'll give you a whatever<B>
that interface Mappable is well known to mathematics, and to confuse the hell out of you, they invented a silly name for it: Functor
you can say that anything that has a some function that has such a map function forms a functor
(this is not an inheritance relation, just something that you could made to apply)
so you could make an instance of that with list
 
11:15 AM
So essentially, without concerning yourself with the type of collection you're dealing with you can express that you want it to be mappable?
 
class ListMapable implements Mapable<List>{ public List<B> map<A, B>(List<A> src, A=>B projection) { return src.map(projection); } }
exactly
and it doesn't have to be a collection either
lots of things are mappable
take for example a Future
a Future is a thing that represents a computation that will be done at some point in the future
 
@Martijn okay
 
A Future<A> is a thing that will at some point have computed some A
you might want to do the same thing to that
Future<A> { public Future<B> followUpWith(A => B transformation) }
that's mappable too!
class FutureMappable implements Mappable<Future> { public Future<B> map<A, B>(List<A> src, A =>B projection){ return src.followUpWith(projection) }
but this all doesn't compile in Java
you can't say Mappable<List>
because List needs a type parameter
 
Okay
 
the best what you can say is Mappable<List<Sometype>> but that robs you of the opportunity to express the projection
 
11:20 AM
I see your point
 
sidestep (or, why type parameters are so immensely powerful)
say I have a function A=>B, and a List<A>
and I have a static method somewhere List<B> mysecretmethod<A, B>(List<A> param1, A=>B param2)
what can List<B> be?
 
let me have a look
 
or rather, what can this method do
note that the method name is undescriptive, it doesn't tell you anything
nor the parameter names, which are generic
 
well, you can map a List<A> onto a List<B> and leave the actual mapping to the function passed as a parameter
all generic of course
I can imagine you might also do some operation on param1 before doing the mapping
or after
 
this is true
 
11:28 AM
but there is more?
 
lets constrain it a little further
static A mysecretmethod<A>(A param1, A param2)
 
Is it some createFrom function?
 
this is the entire signature of the function
you can call it createFrom if you want
static A createFrom<A>(A param1, A param2) { ??? }
 
well, in the previous example the code would have been
return param2(param1);
If that was what you were looking for
I think
here
well, you'll want to combine param1 and param2 somehow to obtain a new A
oh wait, no
 
how?
 
11:36 AM
you can't just do return param2(param1);
you have to map there of course
 
param2 is not a function, so no
map? Where is map defined?
 
That was meant for the first example
 
yes, but I caught your drift
 
39 mins ago, by Martijn
so you have interface List<A> { public List<B> map<B>(A => B projection) }
 
yeah, on the first one, yes
 
11:37 AM
param1 + param2?
 
param1 + param2 you mean?
 
yup
 
syntax error, + is not defined for type A
only on primitives
there are two reasonable things that it can do
let's go even further
 
I need something that all types can do
 
static A anothersecret<A, B>(A param1, B param2){ /* give a}
give some implementation
there is only one reasonable implementation
 
11:41 AM
This is so backwards from how programming usually works :)
Here's the solution, what's the problem?
 
I've only given you the type signature
and I'm claiming you can tell everything there is to know about this function only from its type signature
(with three caveats)
 
I mean
I can do return param1
 
yes
what else can you do?
just say what you are thinking
because it's the right answer
 
nothing
 
yes
because you don't know anything about A
 
11:44 AM
because I have to return something of type A
 
you know exactly what it does
 
and the parameter is all I have
 
if this were Int or something like that, there were a million things you could do
 
I was assuming there was something I wasn't getting
Now I get the point of your questions too :)
It's a very good point
 
so where is the problem?
well, Java has a lot of escape hatches
I said there are three other things that can happen
one of them is for the function to never return at all
 
11:48 AM
run time type information?
does java have that?
 
implementation: static A anothersecret<A, B>(A p1, B p2) { return anothersecret(p1, p2); }
this is somewhat devious, but there is a good compromise for allowing this
allowing indefinite recursion allows a language to tackle a greater class of problems. If the language doesn't have a construct that allows to effectively do this, the language can't be made Turing complete
so we can live with that.
it could also crash the program
implementation: static A anothersecret<A, B>(A, p1, B p2){ throw new RuntimeError(); }
 
But I suppose exceptions are also rather valuable?
 
no
 
@Martijn exceptions aren't valuable?
 
programs can crash. The power can run out. Memory can be corrupt. etc. etc.
so your program might crash unexpected
but throwing exceptions is an escape hatch that lets you screw with code you can reason about
 
11:55 AM
But it communicates something to the users of your function.
Don't do this with this function
 
who are you to tell your callees what they can do to your function?
 
There are certain things that they can't do anyway
the question if if and how they find out when they do try
unless of course you make misusing your function impossible
But that sounds a bit utopian
 
one moment, this doesn't fit in this box
 
That's what sh... and so on and so forth
 
this lets you do whatever you could do before with exceptions
it's called a 'discriminated union'
or sometimes 'Either'
convention holds that what you want to return is Right, and what you don't want (what's left) is Left
static Either<A, Error> anothersecret<A, B>(A p1, B p2){ ??? }
now you can have two implementations
static Either<Error, A> anothersecret<A, B>(A p1, B p2){ return new Right<Error, A>(p1) }
or
static Either<Error, A> anothersecret<A, B>(A p1, B p2){ return new Left<Error, A>(new RuntimeError()); }
 
12:08 PM
Okay, I see the use.
 
now a funny thing (see how everything comes together :))
Either can form a Functor
Either<A, B> { Either<A, C> map<C>(B => C projection) }
for Left: map<C>(B => C projection){ return new Left<A, C>(mya);)
for Right: map<C>(B => C projection){ return new Right<A, C>(projection(myb)); }
I promised you three things that the function could do, so we're still stuck with the third one
that's the most devious one
static A anothersecret<A, B>(A, p1, B p2){ return p1.getClass().getNewInstance(); }
there is simply no excuse for this
 
Agreed, that makes no sense
 
there are more horrible things like that
the example before static A foo<A>(A p1, A p2)
 
I'll have another stab at it
 
this one has two useful opions
and many more horrors
 
12:20 PM
either you return p1 or p2
 
yes
now for the horror
or wait
 
could equally not return
 
if it returns p1, it always returns p1
and if it returns p2, it always returns p2
 
or a new instance
One would hope so
 
yes, those are the horrors. A new instance is one of them. Runtime type information breaks the usefulness of parametricity
worse
static A foo<A>(A p1, A p2){ if (p1.getHashCode() < 7) return p1 else return p2; }
I can call getHashCode because it's defined on Object
so when I said I don't know anything about A, that's not true. I know it has all methods Object has
this is an excellent argument for Object not to have any methods at all
 
12:25 PM
You really are very much pro rigor
I do see your point though
 
if you lose the rigor, you lose the ability to know what your code does
 
Unless of course the people who wrote the code manage not to be idiots
But then it becomes a question of trust
 
these are obviously all very trivial examples. But in the face of complexity, it helps you a lot if you know things about your code to be true, other than hoping it is implemented correctly
and all those silly things. Methods on objects. Runtime reflection. not breaking parametricity
in all languages that allow for simple ways to do that, there are thick best-practice guides
that say "don't ever do that"
well, if you shouldn't ever do it, don't put it in your language.
"but it's so easy for newcomers"
who you then have to tell 3 months down the road that they should have known never to do that
 
There are right (safe) ways to use runtime reflection though, no?
But I suppose your argument is that the usefulness is not worth the possible abuse?
 
runtime reflection should always considered unsafe.
it could be considered for dynamic plugin loading
which is also inherently unsafe, but also useful
 
12:42 PM
What about things like tostring()?
 
super useful for debugging. Not very useful for anything else
what are you going to do with that string? Quite often, it will be something like [I@23fc4bec (i.e. just a memory address)
if you need a string, you need it for some specific application
the object itself rarely knows what it will be used for, so it doesn't know how it should print as a string
(other than for debugging, which is not production use)
challenge: find the first useful use of toString on github
 
was afk for a sec
Once again, I see your point
 
1:43 PM
awwww, I found my first stackoverflow question of five years ago
22
Q: how to use finally

MartijnI never properly understood the use of the finally statement. Can anyone tell me what the difference is between: try { a; block; off; statements; } catch (Exception e) { handle; exception; e; } finally { do; some; cleanup; } on the one hand and: try { ...

I knew nothing!
 
Hi :-)
 
hey :)
going strong with the nice answers @FreeRadical
 
Hey
 
Yup, since I happen to have struggled with the problems CC0 have created for people distributing recorded music in Norway, I wonder if you have any questions that are peripheral to your question about the PD.
 
Norway... Norwegians (damn it, you're a Norwegian too...)
 
1:53 PM
no, it's a pretty nice writeup
I suspect I'll be accepting your answer
 
Scottish, but living in Oslo
 
Pretty soon, there may be a battle between @FreeRadical and @Mnementh for first place in rep :P
 
@Martijn That's not a bad question really
 
nah, I'm going way slower in rep @Zizouz212
 
@Zizouz212, there is no battle. We just try to work together to build up a nice body of answers about Free Culture.
 
1:55 PM
oh, I read that wrong
 
@FreeRadical I support this statement
 
However, I am concerned about how little focus this site has on things other than software. I think we should work on getting a broader base.
 
No, I'm kinda joking around... We had a competition sort of thing during the private beta, and @Mnementh won by a long shot
 
@Martijn You're rising at a pretty good rate too though
 
I've literally stopped with rep...
and I feel like we are focusing on only software, but where can we apply it?
 
1:57 PM
@Zizouz212 I've noticed that as well
It makes sense though, since the seeded questions are running out
 
We need to focus now on promoting the site to everyone, because our artificial questions pertain to our area of expertise: which is software development for the majority of us
 
and not many people are actually applying FLOSS concepts to other things
 
There is a couple of reasons for that. Firstly, The Free/Open movement grew out of open software, and it's the oldest, best known, and probably still largest component of the culture
secondly, SE grew out of StackOverflow, which still means a lot of people on stack exchange have a programming or at least IT background
 
08:00 - 14:0014:00 - 00:00

« first day (34 days earlier)      last day (3153 days later) »