[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 331
Thread images: 13

File: anime.png (786KB, 1000x1300px) Image search: [Google]
anime.png
786KB, 1000x1300px
Old thread: >>56610274

What are you working on, /g/?
>>
Don't use go
>>
Second for that feel when all your well crafted posts in your old thread just die and nobody will appreciate them.
>>
File: 1473934108320.png (2MB, 3840x2160px) Image search: [Google]
1473934108320.png
2MB, 3840x2160px
rolling
>>
>>56615154
https://wiki.haskell.org/Haskell_in_industry

>>56615202
post that shit elsewhere, you fucking retard
>>
Please stop the anime shit

Anime characters don't program
>>
So how do i progress trough python? I wanna learn more but not sure where to read up and such. I can complete easy tasks but probably pretty dirty and not too good, any suggestions?
>>
>>56615241
You progress by not using Python, and forgetting everything you ever learned about it. Learn Scheme and OCaml.
>>
>>56615212
>it's 100% an implementation detail
No its a language feature.
I suggest you try spending 10 seconds (for cute little me please :3) and read this.
https://en.wikipedia.org/wiki/Type_system#Static_type_checking
Then tell me if that Wikipedia article is wrong or not.
Perhaps I can encourage you to edit the article and spend some time in the talk pages getting educated.
>>
>>56615264
>for cute little me please :3
are you a sockposter?
>>
Static types are pointless because you always end up needing to subvert them. Even Haskell has unsafeCoerce.
>>
>>56615154
playing with elixir...I don't know what to think

defmodule Fizzbuzz do
defp fizz?(x) when (rem(x, 3) == 0), do: true
defp fizz?(_), do: false

defp buzz?(x) when (rem(x, 5) == 0), do: true
defp buzz?(_), do: false

def start() do
Enum.map(
Enum.map(1..100, fn(x) -> [x, fizz?(x), buzz?(x)] end),
fn(t) ->
cond do
tl(t) == [false, false] -> IO.puts(hd(t))
tl(t) == [true, false] -> IO.puts("fizz")
tl(t) == [false, true] -> IO.puts("buzz")
tl(t) == [true, true] -> IO.puts("fizzbuzz")
end
end)
end
end
>>
>>56615264
>No its a language feature.
Yes it is. Every sane person already knows that.

>https://en.wikipedia.org/wiki/Type_system#Static_type_checking
I read it
How does this prove that this is not an implementation detail? The link is absolutely irrelevant to the topic.
>>
>>56615264
I think he's accepted that he's wrong. But he's salty about it so he's going down the route of "I was trolling all along"
>>
>>56615296
Nice meme.
>>
>>56615303
An implementation that doesnt follow the spec isn't an implementation. It's a, fork I guess would be the word.
>>
>>56615312
Don't you have anything better to do other than shitposting? Such as you know, making actual constructive arguments?
>>
>>56615303
If the language doesn't enforce compile time type checking it's not a statically typed language.
>yes it is, every sane person knows that
Except you just 1 post ago called it an implementation detail. Meaning it's up for the compiler author to decide. It may be mentioned in the language spec, but not as a requirement or (loss of words here) forbidden feature.
>>56615312
Perhaps. I'm not one to assume malicious intent over ignorance.
>>
>>56615342
The constructive arguments have been made. Static typing has been defined for you. You are arguing a position that is objectively and demonstrably wrong.
>>
I'm kinda sad the interesting part of the argument about dynamic vs static type checking was lost because someone didn't know what they are.
But that's the general case with that discussion I suppose.
>>
If your language cannot define and implement
traverse_
, then you shouldn't use it.
>>
>>56615326
Any spec of any language should not be able to define the way the implementations handle type errors. This should clearly be decided by the implementation.
Anyhow, it seems like you are backpedalling since at the start you claimed that it is always part of the language, while now you say that it is up to the language only if it is in the spec and up to the implementation only if it is not.

>>56615358
>If the language doesn't enforce compile time type checking it's not a statically typed language.
We now know that C is not a statically typed language, just like for any other language that does not dictate the way the implementations handle the errors, right?
We also just learned that we can't use an interpreter for statically typed languages. Yeah no.

>Perhaps. I'm not one to assume malicious intent over ignorance.
Nice circle-jerk
>>
>>56615378
>you must implement specific keyword
Well you're really putting yourself in a rather limited space of languages.
And I suspect you've removed yourself from languages capable of producing quality software.
>>
>>56615361
>The constructive arguments have been made
Not by (you) at least.

>Static typing has been defined for you
Yes, I asked the definition that a certain person used and I got a reply to it. I also argued why such a definition is retarded.

>You are arguing a position that is objectively and demonstrably wrong.
I am still waiting for it to be proven wrong.
>>
I don't code or anything, but I've got a post for you today.
>At work, doing my job, work as a butcher in a supermarket. Cute girl I know from another department comes into my stock room (we share one of our rooms with the oven fresh chicken), talks about how she's going to uni
>I ask her what she's going to study
>Programming
>Oh yeah? Any particular language or just generally going to learn and decide on one later?
I fucking kid you not, this is as close to her exact words as I can recall, and I'm pretty certain its 100% exact spot on.
>"Oh yeah. I know HTML, CSS. I've tried Java, but I found it a bit too complex. I can build a website if I've got someone else's framework, but I can't do it from scratch."
>So, you're going for webdev eh? Are you thinking of doing front end or back end?
>"Uh... what? I don't really know (giggles). I'm just gonna learn whatever."
...She has no chance of learning shit. She's cute, but she's a halfwit. I mean, shit guys, I thought uni was for the people who already knew their shit and wanted to progress even further? HTML & CSS is fucking kiddie shit.
Hell, my fucking niece is learning some really basic programming at the age of 6 (right now) at school.

But you know what? She'll undoubtedly get a semi-decent job somewhere purely on the fact she's a woman and the government tells companies they need equal (or close to equal) amounts of men:women.
Fucking sad.
>>
You can't really say a language is either statically or dynamically typed. There's a big spectrum. A couple of illustrative examples:
1. Lots of languages are called statically typed even though you need runtime checks for e.g. ensuring an index is within the bounds of an array. Yet this invariant is possible to encode in a dependently-typed language as a type. Does that make it a dynamic type check in the non-dependently-typed language?
2. Dynamic types can be encoded in a statically-typed dependently-typed language. A value of "dynamic type" is just a value of a sigma-type where the first element is the RTTI and the second is a value of a type depending on what the RTTI means.
>>
>>56615401
It's not a keyword, it's the name of a function. Its full signature is:

traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()


If I'm putting myself in a rather limited space of languages, then that can only be because most languages are terrible and should not be used.
>>
>>56615395
>c and errors
It does dictate a large deal about errors and warnings
>cannot use an interpreter
Well it's not spec compliant. Just like how you could mess with C++'s vtables, but it's not spec compliant.

I'm not sure your perspective on languages is all that clear.
And I doubt this was the argument you had intended to have to begin with.
>>
Can anyone recommend the best online course to learn algorithm design? How to calculate complexity, proofs, etc.

I just started my MSc but it's been 5 years since I graduated and I've forgotten most of the academic stuff.
>>
>>56615438
Any course in 'algorithm design' is likely meaningless.
>>
>>56615430
>It does dictate a large deal about errors and warnings
It does not force type errors to be at the time of the compilation.
Also C allows the use of interpreters.
Are you claiming that C is not a statically typed language?
>>
>>56615301
I don't know any elixir, but why don't you define:
  defp fizz?(x) do: rem(x, 3) == 0
defp buzz?(x) do: rem(x, 5) == 0

For that matter, why not:
  defp divides?(d, n) do: rem(n, d) != 0

?
>>
/g/, i'm pretty new to coding and whatever

i'm trying to create a program that makes a random number, and then it adds the random number to your input

    srand (time(0));
cout << rand() << endl;

int a;
cin >> a;

cout << a + rand();



However, it doesn't give me the right answer, the random num was 41, i tried to add 5 but instead of giving me 46 it gave me a crazy number like 13046
>>
>>56615421
This is one of the reasons why this distinction is retarded.
>>
>>56615424
Write a program that averages (no memes, just take care of overflows) a random, run time determined set of integers and tell me when you've reached less than 1.5cycles per integer.

Because that was my 10 minute implementation in C++ (regrettably) and if your language can't do that then I'd consider it too slow to be usable for any serious task. As a simple two instruction algorithm is such an easy case and so core to what you do in programming that your compiled code will run far too slow in real situations that it's simply unacceptable.
>>
>>56615503
It's not that there's no distinction, it's that there isn't a single meaning of "statically typed" and a single meaning of "dynamically typed". However, you can describe languages as having the capability to check certain things statically as opposed to at run time.

C has the capability to check certain type invariants statically. It doesn't have to, by the spec.
>>
>>56615497
The second time you call rand() it generates another random number, it doesn't reuse the one from before
>>
>>56615420
>I don't code or anything
Then don't post.
>>
>>56615540
I don't think that there is something from stopping python from doing the same.
>>
>>56615550
Stop me. Go ahead.
>>
>>56615528
I have no doubt that Haskell can do that, with judicious use of the ST monad.

You know that 'real world' software is more complex than averaging a set of integers, though. Haskell code is a hell of a lot more maintainable than C++ code, and so far better suited for most 'real world' software.
>>
>>56615463
It forces type errors to be errors at the time of compilation (it's just true that they're errors at that time) while in dynamically typed languages they're not necessarily errors because circumstance in the program may lead them to not being so.

Is this really that hard to get?
>>
>>56615557
Oh, no, there definitely is. Type inference for a language as expressive as Python is undecidable, hence you need type annotations, which it does not have.
>>
>>56615577
>It forces type errors to be errors at the time of compilation
Please do not talk about topics that you have any idea about. C does not "force type errors to be errors at the time of compilation", this is simply wrong.
Read the standard.
>>
>>56615420
/g/ - My Blog
>>
>>56615574
>i have no doubt haskell can do that
Do it. Its a very simple task by design so you could do it trivially right now.
>real software is more complex
Yes, but any real software you haven't made arbitrarily complicated will have a set of operations that actually transform data. If that's too slow (because if it's a well constructed program it's a large part of the program, since transforming data is all programs really do) then your program is too slow.
>>
>>56615528
Very few languages are capable of this.
>>
>>56615627
I can't do it right now, I don't have a Haskell compiler on my phone.
>>
>>56615548
oh

is there another way i can do this?
>>
>>56615585
>Type inference for a language as expressive as Python is undecidable
What can you do in python that you can't do in OCaml or F# as easily?
>>
>>56615608
>read the standard
Understand what an error is.
Anon you're just dodging at this point. Go ask someone you trust in knowing C.
I'm not gonna try anymore. You've been given plenty of evidence that supports all the claims I made before, you moved the goalposts to a place where you don't fully grasp the language (in the spec, not C as a whole, though one implies you don't get the other). And now we're arguing semantics.

So no this is over anon. If you really want to know there's good sources.
>>
>>56615668
Get a job
>>
>>56615421
>Lots of languages are called statically typed even though you need runtime checks
Static typing only refers to compile time type checking. it has nothing to do with runtime.
>>
>>56615585
>which it does not have
There was a RFC by guido on that topic where he actually proposed type annotations. I doubt that it will be added any time soon however.

>Type inference for a language as expressive as Python is undecidable
I will have to doubt that. Until I see a better explained reasoning at least.
>>
>>56615656
Store the result of rand in a variable and reference that instead.
>>
>>56615652
Fair enough. My issue with haskell is mainly that the benchmarks I see are horrible and my (fairly limited use) has shown me that they're very hard to optimise for.
>>56615644
Very few languages are good enough to write good software in then. And that's a shame. I agree its rare. Its why I use C and C++. Its not because I particularly like them all that much.
>>
>>56615682
You have not given any evidence, instead you keep posting bullshit with nothing backing it up.
As I said, C does not "force type errors to be errors at the time of compilation", the standard does not force that, this is all. What is so difficult to understand?
I have given plenty of arguments to you however I have yet to see you actually trying to dispute them with reasonable replies.
>>
>>56615668
Well, expressive in the sense that you can write code for which type inference is undecidable, since the syntax is not as restrictive.

>>56615686
How about you finish reading?

>>56615689
It's not hard to make inference undecidable. Python allows you to write code that you'd need dependent types to statically type. Complete type inference for dependent types involves higher order unification, which is undecidable.
>>
>You can't pattern match on types in Haskell.

Is this true?

This was one of the few reasons I gave Haskell the benefit of the doubt in some small portion of my mind.
>>
>>56615708
Sure, it's easier to write a well-performing C++ program than a well-performing equivalent Haskell program, but for both languages you need expertise in order to eke out maximal performance.

In the field I work, Haskell's performance (when written well, but not going over the top with optimizations) is acceptable, because we don't have real-time requirements. Haskell's other benefits (faster development time, easier refactoring, better code reuse) are more useful than the performance benefit we would get by switching to C++. From your posts I assume the cost/benefit analysis works out differently for the work you do.
>>
>>56615753
Well, you can, with type families; this makes a type-level function, essentially.

You cannot match on types in the body of a regular function. You can use type classes for ad hoc polymorphism, but the point is that it is open and not closed. If you want something like "closed ad hoc polymorphism", you can use algebraic data types.
>>
I need a little clarification. Say I want a python script that receives input from a remote user in the form of a youtube link and runs it through youtube-dl, how would I best do this? Download locally, upload to a temporary file hosting service like MyAirBridge, and then purge from local system?

Would this be more webdev/IT territory at this point?
>>
>>56615753
Yes, it's true. Being able to do that would destroy parametricity.
>>
>>56615229
https://github.com/baku89/Subete-ga-F-ni-naru-ED
they do :3
>>
>>56615744
>How about you finish reading?
i did.
>>
>>56615799
So what do you think about the rest of the bullet point?
>...for e.g. ensuring an index is within the bounds of an array. Yet this invariant is possible to encode in a dependently-typed language as a type. Does that make it a dynamic type check in the non-dependently-typed language?
>>
>>56615791
Not to mention that it would require RTTI overhead.
>>
>>56615834
But but Java generics are shit because C# did them differently who even cares about free theorems and correctness lol academic ivory tower nonsense is triggering me you're uninvited from my conference.
>>
>>56615865
I think you replied to the wrong person.
>>
>>56615821
All statically typed language allow you to do dynamic typing. You can cast shit to whatever you like, and that only get's checked at runtime. Static Typing does not mean all code is verified to be valid at compile time. It just checks the types are consistent.
>>
>>56615241
Don't listen to them. Python is an amazing language. It's a hell of a lot more flexible than C/C++ and fuck Ruby.
Learn Python the Hard Way
Codecademy

Practice polymorphism, read and experiment a lot.
>>
>>56615878
I'm banning you from posting any comments containing the letter e because you violated my code of conduct
>>
>>56615879
There's a difference between the ability to do dynamic typing, and whether the language would be considered by the majority of reasonable, informed persons to be "dynamically typed".
>>
>>56615883
Python fucking sucks, stop trying to destroy his brain with it.
>>
>>56615251
>You progress by not using Python, and forgetting everything you ever learned about it.
Okay, I'm with you.
>Learn Scheme and OCaml.
Aaaaaaand you lost me.
>>
>>56615879
>All statically typed language allow you to do dynamic typing. You can cast shit to whatever you like, and that only get's checked at runtime.
All of them? That's a hefty claim.

>Static Typing does not mean all code is verified to be valid at compile time. It just checks the types are consistent.
Sure, but propositions are types and vice versa. X language can enforce something with its type system while Y can only do it at run time. That's all that matters.
>>
>>56615911
And why does Python suck?
Let me guess, you use a low level language such as C, even though C is a complete waste of time unless you're writing drivers or kernel source code or other low level code.
https://wiki.theory.org/YourLanguageSucks
>>
>>56615940
Your guess is wrong. I haven't used C in years.
>>
>>56615909
I completely agree. Almost all statically typed language can do dynamic typing. But when dynamic typing is all a language can do, then it is broadly considered to be dynamically typed.
>>
Are there any sites I can use to find remote work? I have a lot of downtime but I've never been all that good at freelancing
>>
>>56615955
Okay. Well, no language is perfect. You still haven't given any reasons as to why Python sucks.
>>
>>56615883
>It's a hell of a lot more flexible than C/C++
Wat.
I like Python generally anon, but I'm not sure what this is supposed to mean.
>>
>>56615770
Yes it does. From what I've seen of haskell performance would simply not be a concern for it to make sense.
But considering how easy that solution was in C++ i don't think you need expertise. That's probably what attracts me the most to it. If I could reach the same results in haskell (and other people don't really do that in benchmarks), I'm not confident it'd be a win simply because it'd be a lot of effort.
The gains I see in development speed. Yeah they can be quite large, but only when you don't care about performance to my knowledge. You hope that haskell is fast enough. Because obviously you don't accept software that takes an eon to run.

But I've also never seen any real issues with just implementing something. Its always the constraints that get to you.
>>
>>56615972
Dynamic typing.
Absurd scoping.
Its lambdas are toys.
The GIL.
The version split.
>>
>Some development teams actually connect sirens and flashing red lights to their test systems, so that it is impossible to ignore a failing test. They then search out the programmer who caused the failure and make her pay for coffee for the next week.

Really?
>>
In C if I have the following code:
if(expr1 && expr2 && expr3)

are all expressions evaluated first or are they evaluated one by one. If expr1 is false, wil expr2 be evaluated?
>>
>>56615883
>Pros of python
* Easy to import libraries
* Well established within certain circles
* Can often make small (and often hacky) modifications to code to 'just get something to work'
* Multiparadigm
* Reflection and introspection (this is genuinely quite huge)
>pros of codeacademy
* Gets a person going with programming due to friendly interface and achievements
* pretty interface

Ask me for cons
>>
>>56615989
I disagree that you don't need expertise for C++. For anything non-trivial in C++ you need to know a lot about the many parts of the language and how they interact with each other. Any time I have to think about exceptions and RAII together I get very nervous. Not to mention the various different constructors, move semantics, and what-not. It's a very powerful language, sure, but it's not at all easy.

In contrast, I find programming in Haskell much more intuitive. Perhaps it's because I learned a functional language before I learned C++.

Haskell normally is fast enough for the things I use it for. If it ever isn't? Well, I guess I'll discover how good its C FFI is.
>>
>>56615986
Low level languages in general are more verbose and become unnecessary for most tasks. For the most part in C there is a right and a wrong way, with Python I can achieve the same result in a plethora of different way. It's flexibility is one of my favorite aspects.
>>
>>56615911
>reason: it suks x-DDDD
>here learn these languages that aren't really applicable anymore because they'll magically teach you concepts you are still supposed to learn no matter what language you choose
This meme is actually the worst and it needs to stop.

>>56615883
>Learn Python the Hard Way
>Codecademy
You're not as bad as him but you sure are trying.

>>56615930
Just stick with Python if you're comfortable with it already. Use Automate the Boring Stuff for Python to start out (https://automatetheboringstuff.com/) and transition to more scholarly text. John Zelle (https://www.amazon.com/dp/1590282752/) and John Guttag (https://www.amazon.com/dp/0262529629/) are good once you move out of Automate.

From there most people usually head into C, Java, C#, or C++.
>>
>>56615415
>Yes, I asked the definition that a certain person used and I got a reply to it
You were linked to the definition on wikipedia. While it's just wikipedia it's more than you've provided. Find a single credible source that suggests type systems work the way you think they do
>>
>>56616007
ikr misgendering programmers is not cool
>>
>>56616007
>her
No it doesn't happen
JOKES aside failing tests is what they're there for. Sirens for failing tests would be constant and counterproductive as it encourages avoiding effective programming where the safety net of tests let you go fast.
>>
>>56616040
it follows the programming order of operations, but yes that is an optimization your compiler does for you
>>
>>56615999
Besides GIL and maybe the version split all of those are completely subjective.
>Stop liking what I don't like
>>
>>56616088
>You were linked to the definition on wikipedia
No, I was not.
Why are you lying anon?
>>
>>56616007
I still occasionally hear the monitor beeping sound that we had at my previous workplace, at night when I'm trying to sleep, even though it's not actually there.
>>
>>56615932
>All of them?
Almost all. Except for meme ones.

>X language can enforce something with its type system while Y can only do it at run time. That's all that matters.
That was my point. X is statically typed if it can enforce it at compile time, and Y is dynamic.
>>
>>56615736
http://thesis.haverford.edu/dspace/bitstream/handle/10066/624/2004RushtonM.pdf?sequence=2

Any other thesis or paper on the subject will give the same definitions. You're out of this world levels of wrong
>>
>>56616111
I assume it's only during code reviews, not just compiling any random program (in which case you'd throw errors to avoid that anyways)
>>
>>56616125
So C is dynamically typed because it can't encode "index within bounds" as a type and subsequently enforce it statically?
>>
>>56616040
>If expr1 is false, wil expr2 be evaluated?
https://en.wikipedia.org/wiki/Short-circuit_evaluation
>>
>>56616119
Then why on the line
if(j > 0 && map[i * x + (j - 1)] == '*') n++;

leads to a invalid read according to valgrind? I'm sure I'mnot going out of bounds here...
>>
>>56616079
>You're not as bad as him but you sure are trying.

Well, I figured those are good starting points for someone who isn't ready for doc pages and other references.
>>
>>56616155
No, because C verifies lots of type consistency at compile time. It doesn't need to verify everything, and it doesn't.

If C didn't verify any types at compile time, then it would be dynamic.
>>
File: standard.png (78KB, 855x460px) Image search: [Google]
standard.png
78KB, 855x460px
>>56616040
>>
>>56616194
So you agree that static vs. dynamic is a spectrum, which was my original point?
>>
>>56616194
>C verifies lots of type consistency at compile time
False
The standard does not enforce that.
>>
>>56616079
Learning Python makes you a bad programmer. You use the language as a crutch, and it makes it harder for you to pick up other languages, because you're not used to the typechecker calling you out and making you get things right.
>>
>>56616069
>RAII and exceptions
Well they're for bad programmers.
Sure, I may be a little bit disingenuous when I say no expertise is required. Because for instance inheritance is extremely limited and practically useless. A knowledgeable OOP programmer would write his own inheritance system.

My point was that a fresh student could write a fast averaging of ints (or any other basic algorithm) that performs very well without any help.
1.5cycles per int requires SIMD, which while its not hard in any way it's something the student would require guidance for, so 'very well' is slower than 1.5cycles per int. But no doubt it's still gonna be fast.
Getting the same speed in haskell is no doubt very hard and personally I don't even know where to begin.
>>
>>56616179
>I'm sure I'm not going out of bounds here.
Did you check? You use an ellipses so I'm assuming you didn't.
>>
>>56616205
Except it isn't. Once it's compiled the compiler can do no checking. Bare metal languages can break their type system if they want, by virtue of having access to features the language itself doesn't support. C is statically typed, it's also unsafe. This is a fundemental flaw not a feature and is independent of the languages type system. I assure you, a transistor has no concept of a type.
>>
>>56616142
Well sirens during code reviews would make less sense. Disturb everyone that's working when you've already decided on disturbing the one person who did the mistake.

Horrible company culture if that's going on. It'd be like one of those teen movies about American highs schools where there's groups and constant fighting, with practically no focus on the actual school.
>>
>>56616196
>>56616170
Thanks!

>>56616224
I check if j is bigger than 0. x is always bigger than zero because its a size I've set and the lowest i can be is 0 because its an index from a for loop. Basically, if j > 0, the lowest value that i * x + (j - 1) can be is 0, which is not out of bounds.
>>
>>56616251
>Once it's compiled the compiler can do no checking
Sure it can.

>Bare metal languages can break their type system if they want
By definition a compiler may transform the source into non-"Bare metal languages".

>C is statically typed
Not by your definition.
>>
>>56616205
Eh, not really. But i guess at an extreme interpretation of the definition they can be?

If a language checks a lot of types at compile time, and that is encouraged, then it is statically typed.

If a language check nothing at compile time, then it is dynamic. I don't know of any langugaes that do almost no type checking at compile time but still do a little... do langugaes are either clearly dynamic or static.

The closed thing to a mix between the two I can think of is objective-C. Which supports static typing but encourages a dynamic style. It's kinda retarded though.

>>56616217
so
byte b = 300;

is valid C?
>>
>>56616220
>because you're not used to the typechecker calling you out and making you get things right.
You'd never be used to something new to you to begin with though.

In my experience going from Python to C was easy, the compiler is a learning tool of aid not a point of friction.

That being said I'd probably tell someone to learn Go as their first language before Python. Honestly though there's no right answer for everyone since everyone learns differently and has different goals in mind as well.
>>
>>56616272
if i * x + (j - 1) >= the size of the object that map is pointing to then you are out of bounds.
>>
File: 1457818888184-0.png (1MB, 1920x1080px) Image search: [Google]
1457818888184-0.png
1MB, 1920x1080px
Ok so I did read a lot about algorithms, took a grasp on dozens of programming languages and I hesitated way too long on where to start.

My projects : Webdev for a living, Vidya for leisure (including shaders...)

I'm gonna do several workshops (rosettacode, etc) just to get started, and I chose the following languages :

Python and Racket

Eventually, I'll learn some strongly typed language.

Would you give me a final warning ?
>>
>>56616278
>so
>byte b = 300;
>is valid C?
Assuming that byte is an integer type or a macro that does not output something fucked up, as well as b not being already used for another variable or something else retarded, then sure.
>>
>>56616275
>Sure it can.
Ya, this c executable I'm running is totally checking itself with the compiler.

>By definition a compiler may transform the source into non-"Bare metal languages".

What a move of the goalpost. And completely irrelevant to the context of the discussion.

>Not by your definition.
What an argument.

I'm sure you think you're winning this discussion in your head, but saying "no that's wrong. Not by YOUR definition(according to me)." etc isn't actually making an argument. It's deflecting from your lack thereof
>>
>>56616295
>vidya for leasure
Your python and racket won't do any good.
>web
Dunno.
>python vs racket
I don't know racket, but I find Python to be acceptable for certain use cases.
>>
>>56616313
C won't flip out that 300 is not a valid byte literal?
>>
>>56616325
>Your python and racket won't do any good
Only to learn the two paradigms
I'll probably learn a strongly typed language for vidya later
>>
>>56616313
>assuming you jump through all these hoops to deliberately break the type system in ways the compiler can't prevent sure.
>>
>>56616272
I doubt it's the issue but parenthesise your maths more.

Are you sure you're referencing the right map? is the result bigger than your map has elements?

It's hard to guess what the problem is with all the variables being unknown.
>>
>>56616313
Is
 
1Hshshdgaidgga 1def =dgsgsgsvsvs //no macros, semicolon not emitted, assume basic main function surrounding this

Valid C?
>>
>>56616336
>C won't flip out that 300 is not a valid byte literal?
why don't you ask your compiler
>>
>>56615192
tee archive_of_my_shitposts.txt < post > 4chan.org/g/dpt
>>
>>56616350
Not sure the paradigms will help you either.
I say 'not sure' but I really mean that they won't and they could cost you years of time.
>>
>>56616290
Apparently, I've missed something.
Thanks anyway!
>>
>>56616321
>Ya, this c executable I'm running is totally checking itself with the compiler.
is that supposed to be funny?

>What a move of the goalpost
It moves no goalpost, it simply notes a mistake in what you posted.

>What an argument.
It is not an argument. It is a fact if we go by your definition. How can you not know your own definition?
>If C didn't verify any types at compile time, then it would be dynamic.
>>
>>56616360
>Emitted
Omitted. Damn phone.
>>
>>56616336
That will likely go trough with java too.
Then again I don't know what java's standard says about signed overflow.
>>
>>56616336
byte is not a type defined by the standard, it depends on what you define it.

>>56616353
You are not making much sense. What I said holds true in pretty much any language.

>>56616360
I don't think so, how is it relevant however?
>>
def fib(n):
global numOfCalls
>>
>>56616374
>I really mean that they won't and they could cost you years of time.
Yeah but seemingly if I want "useful" languages there isn't much besides Java and C++ (cuz libraries and stuff), but the learning curve is steep AF and I somehow feel they're the same use
>>
>>56616381
>is that supposed to be funny?
Yes. It's also supposed to point out what a moron you are. The beauty of sarcasm.

>It moves no goalpost, it simply notes a mistake in what you posted.

>c is a baremetal language
>NOT IF YOU HAVE A COMPILER THAT TURNS IT TO PYTHON!

>>If C didn't verify any types at compile time, then it would be dynamic.
You've got the wrong guy moron. And C does verify. You can just break the verification. If I crash my car at 200mph I'll total the car. Doesn't mean the car doesnt have superb safety features, it means I deliberately ignored them (and more than likely modified the car)
>>
>>56616397
It's relevant because the argument you make about what an error is is faulty.
There's an identifier there starting with a digit. Its an error. The 300 into a byte is also an error. Its an overflow. The program is undefined.
>>
>>56616429
>>c is a baremetal language
You didn't say that.
Also, it is a fact that C is not a bare-metal language.

>And C does verify. You can just break the verification
Explain what you mean exactly then.
>>
>>56616456
>it is a fact that C is not a bare-metal language
>compiles to assembly
>not bare metal
>>
>>56616409
Yeah, there's not much but C or C++ for games.
But it's not about the languages really. The paradigms (OOP and functional) are widely regarded as hurtful or not helpful now. And that's only going to be more and more understood in the future. So it won't help your leasure game programming assuming they're correct.
Doesn't mean it won't help your Web programming, but I don't know about the Web.
>>
>>56616479
>functional
>widely regarded as hurtful or not helpful
You're living in your own little world
>>
>>56616479
>FP is widely regarded as hurtful
?
It's just a natural extension of procedural programming whereas OOP goes completely off on a tangent. Should have been called retained-mode-GUI-oriented programming.
>>
>>56616477
>assembly
>not compiling to microcode
"bare metal"
>>
>>56616435
>It's relevant because the argument you make about what an error is is faulty.
I did not make any such argument.

>There's an identifier there starting with a digit. Its an error
It seems like it, indeed.

>The 300 into a byte is also an error
And this is wrong. No type named "byte" is defined by the C standard so unless we know more about the type we can't say what values may be assigned to it.

>The program is undefined.
I am pretty sure that the standard does not consider this as UB.

I still wonder however, how is it relevant at all to my argument?
>>
>>56616477
>compiles to asm
>bare metal
Asm code is made to be quite portable. Bare metal would be what you input for a chip programmer to use.
>>
>>56616477
>>compiles to assembly
Literally every language can do that.
Also, most modern C compilers compile it into IRs.
>>
>>56616503
In games.
>>56616509
In games.
Where you care about performance to a degree.
>>
>>56616260
I imagine it is in a lighthearted manner but yes a bit humiliating if you aren't really fitting in with that culture

It's probably just for fun mate
>>
>>56616551
You realise that the issues people have with OOP isn't just performance? And that there never was and huge functional gaming scene?
>>
>>56616541
>Literally every language can do that.
Literally every language doesn't allow unsafe access to hardware like c does. The ones that do just wrap c libraries.
>>
>>56616551
OOP is detrimental to performance on a macro level. It forces you to organize your software in a way that ignores how computers work.

FP can be detrimental to performance on a micro level if you get overly obsessed with laziness or purity (if you don't understand that effects can be pure).
>>
>>56616592
C does NOT allow "unsafe access to hardware". Such a thing is not part of the standard.
You are clearly not qualified to talk.
>>
>>56616622
>Such a thing is not part of the standard.
You have no idea what a standard is or does.
>>
>>56616635
Nice claim.
>>
>>56616131

I like how you just ignored this post altogether despite responding to every other post that replies to you
>>
>>56616578
For good reason. OOP was moved onto games because of C++ and outside pressures.
>>56616578
Yes I know. But you were talking about FP, at least that's what I replied to because OOP is just a shit show i don't feel the need to discuss.
>>56616600
Much like OOP. Its a way of orienting code. Abstracting away data and 'storage'. Often you don't even have facilities to consider the platform. Its unhelpful and thus harmful.
>>
>>56616643
Really, you're going to play that game after
> Such a thing is not part of the standard.
>You are clearly not qualified to talk.

lol. Language arguments, now brought to you by dick cheneys playbook.
>>
>>56616551
If you ever use callbacks you're doing FP.
>>
>>56616677
>Much like OOP. Its a way of orienting code.
Not really. Functional programming is about two major things:
1. Greater power for abstraction and inversion of control
2. Greater power for reasoning and optimization through purity
Organizationally, FP is the same as procedural programming. You have data (structs, algebraic data types) and you have code (procedures, functions).
>>
>>56616684
Considering that you make bullshit claims about C and how you support that things that are not in the standard exist in C make you not qualified to talk. Do you think that I am being unreasonable or something? Because it seems fair to me.

>>Such a thing is not part of the standard.
Do you disagree with that statement?
>>
>>56616479
>Yeah, there's not much but C or C++ for games
Why not D or Rust ?
>>
>>56616723
>abstraction
Well you didn't understand my post then
>>
>>56616736
>If I keep making unsourced claims while accusing others of making unsourced claims I win the argument
>>
>>56616758
"Abstracting away", i.e. hiding implementation details, is actually called "encapsulation".
>>
>>56616775
>abstraction is encapsulation
false
>>
>>56616770
Source: the standard
Your turn.
>>
Rust can't do higher-rank polymorphism or higher-kinded types. Rust is a bust.
>>
>>56616788
But that is exactly what >>56616758 is implying, not me.
>>
>>56615497
Look up mt19937, it is much better to use then srand(), also you have to store rand in a variable
>>
>>56616790
>I'll just say the standard. That'll totally make me look smart.

I've already sourced an article on the definition of static typing. It remains the single post of mine which you haven't responded to. Some other anon linked wikipedia or something, you just ignored that part of his post.

You're a hypocrite, demonstrably wrong (and have been demonstrated to be wrong) yet you keep accusing others of baseless unsourced claims while making baseless unsourced claims.
>>
>>56604912
Well anon it at least keeps some things in order. C and C++ is high level. Low level is essentially just asm atm.
Machine langauge is not ASM.
Computer hardware (say circuit programming) is a more low level than everything else.
I'd probably replace human languages with math or some logical language.
>>
This thread fucking sucks today.

Post what you're working on.

I finished a project today for a client, and they asked me for additional features, including API integration, a backend historics database, and a GUI for a section that isn't even supposed to be interacted with by the user.

Here's the kicker; they wanted me to do it for free after I pointed out it was a massive scope change.

https://www.youtube.com/watch?v=jVkLVRt6c1U
>>
>>56616836
I'm making a bittorrent library. I have no idea what I'm doing. It's fun though
>>
>>56616794
It can actually do higher-rank polymorphism with lifetimes. Checkmate, atheists.
>>
>>56616800
No. I'm not. You're retarded for thinking that encapsulation == abstraction.

Encapsulation has to do with shared state. Abstraction is another can of worms which we wish would grow into butterflies already but it never seems to do that because they haven't evolved from being earthworms.
>>
>>56616220
>You use the language as a crutch
>it makes it harder for you to pick up other languages
For webshits who were run through a bootcamp, maybe. Modern teaching/instructional practice revolves more around teaching concepts and logical thinking. Even then, syntactically the jump isn't big for the raw basics:
Python:
print()

Java:
System.out.println();

C:
printf();


The only exception to the print example would be C# which uses
Console.WriteLine()
. Any modern introductory textbook will not ground itself in the language it introduces. It isn't a large leap of faith to go from Python to a strongly-typed language if they're not using CodeAcademy/LPTHW which is pure syntax with little to no conceptual introduction. Especially so if the learner will end up using another modern book to learn their next language.

>>56616182
Introduction to concepts and programmatic thinking >>>>>>>>>>>> repeat-after-me drills.
>>
>>56616870
It's not full higher-rank polymorphism, though. It's yet another example of a language that takes only the most simple, banal, first-order approximations of FP features and thinking that's enough. It isn't.
>>
>>56616870
prove it
>>
>>56616878
>You're retarded for thinking that encapsulation == abstraction.
Where did I say this? I said FP was good for abstraction, and the other anon (you?) said that that makes FP inefficient because abstraction hides details (encapsulation).
>>
>>56616829
>I've already sourced an article on the definition of static typing
While replying to a totally irrelevant post, ignoring the rest of its arguments (happens in every post that contains an argument where you are being called out actually) and making no actual contribution.

>you just ignored that part of his post.
This is false.

>You're a hypocrite
How so?

>demonstrably wrong (and have been demonstrated to be wrong)
The reverse has been the case.
You have been proven to be unreliable and to not know what you are talking about more than once in the past 2 threads.

>yet you keep accusing others of baseless unsourced claims while making baseless unsourced claims.
I am unsure how you expect me to prove that something does not exists in the standard. It would be easier if you pointed to me where it exists.
>>
>>56616913
Detail hiding through abstraction and detail hiding through encapsulation are two different things. In fact encapsulation doesnt have to hide details at all, it can just wrap them in more details.
>>
>>56616903
where F: for<a'> in Fn(&'a Foo) -> &'a Bar
>>
Why do people use languages like C and C++ when they know they aren't going to do anything with it. People always say python and other high level languages are terrible, but they end up being the languages that get you the job you want. Whether it be analyzing data or webdev, python is usually the language people want. Lower level languages are only going to end up being good for like kernel shit and stuff like that, and all of those jobs will be taken by real computer scientists, which is literally no one here.
>>
>>56616939
>Detail hiding through abstraction and detail hiding through encapsulation are two different things.
Abstraction doesn't hide details.

>In fact encapsulation doesnt have to hide details at all, it can just wrap them in more details.
That's not encapsulation, then, that's e.g. composition.
>>
>>56616913
No I (yes me) said (implied) that abstraction makes FP inefficient because the programmer is the one who knows what's supposed to be done and abstraction doesn't currently allow for the correct level of expressiveness to actually do things effectively (the compiler can't reason enough to produce the right results in the least amount of instructions). That's the general case. Now as I expressed I do wish abstractions were efficient but nobody has done that yet.
Also >>56616939
Thanks for posting that.
>>
>>56616926
Again, you keep making claims and accusing others of the things your doing. That's fine if you're donald trump but you've been on your own this entire time, while multiple people have tried to explain why you're wrong. Keep believing whatever you want, but at least believe it with facts and not ignorance.
>>
>>56616898
I'm not talking about syntactic differences.

If you've already been inculcated with Python, when you try to go to another language and its type checker starts yelling at you you'll think "this is shit, why would anybody use this, Python is much better". That wouldn't happen if you hadn't first used Python.

Python encourages sloppy code, not thinking too hard while writing it, and figuring it out later by spamming tests. A decent statically typed language does the opposite. It makes you write more correct code upfront, and the payoff is being able to get away without a huge portion of the tests that are necessary for code written in a dynamic language. Types also make it harder to get refactoring wrong, and enable better, smarter tooling.
>>
>>56616985
Can you give some concrete examples of where an FP abstraction "hides details" and doesn't allow optimization either by the programmer or the compiler?
>>
>>56616988
>Again, you keep making claims and accusing others of the things your doing
Funny, considering that you started doing that.

>That's fine if you're donald trump but you've been on your own this entire time, while multiple people have tried to explain why you're wrong. Keep believing whatever you want, but at least believe it with facts and not ignorance.
It's clear that you lack arguments.
>>
>>56616943
this doesn't look higher kinded
can you implement traverse?
>>
>>56616970
>Abstraction doesn't hide details.
That's the definition of abstraction.

>That's not encapsulation, then, that's e.g. composition.
No. Compsition is associative, encapsulation is transitive. Encapsulation has a defined hierachy which composition does not. (I'll be honest, I'm sketchy about how correct I am about that particular remark)
>>
>>56617063
I didn't say it was higher-kinded. I said it was higher-rank lifetime polymorphism.
>>
>>56617063
I think he's tackling higher-rank polymorphism rather than higher-kinded types
>>
>>56617067
>>Abstraction doesn't hide details.
>That's the definition of abstraction.

doTwice a = 
do a1 <- a
a2 <- a
pure (a1, a2)
>>
>>56617067
>That's the definition of abstraction.
Actually it's the definition of encapsulation.

>Compsition is associative, encapsulation is transitive.
What the fuck do you mean by this?
>>
>>56617013
>Funny, considering that you started doing that.
You're still doing it. Every argument you make is "I know you are but what am I" and "no you're wrong because I say so". You've given no tangible source whatsoever other than hoping that saying "the standard" will scare off anyone trying to explain why you're wrong. I've stopped trying to explain why you're wrong, all I've been doing for the last half dozen or so posts is calling you out on being a hypocrite. And I'll keep doing it every time you respond until you start sourcing your claims and in non vague ways. Yes saying "THE SPEC!!!" is as vague as you can be while still pretending to have a reference.
>>
>>56617100
Why not
doTwice a = a *> a
?
>>
>>56617007
You can choose any example in haskell.
>doesn't allow the programmer to optimize
That's not the point. That's never the point. Because you can call C code which is inline assembly so you can always avoid Haskell enough to write proper code.

The language abstraction facilities doesn't allow the expressiveness as abstraction facilities to generate the ideal machine code.

I can't say "these integers are 16bit, I'm wishing to only have this compile at an AVX capable machine with 4 cores and hyperthreading, they're supposed to undergo this set of operations where these depend on each-other and these do not, the set of integers aren't alligned on 16byte boundraries and they do not require any read or write boundraries for these operations".

I can't say that, I haven't met any abstraction that lets me say that.

If the sentence I wrote could be compiled code that generates what I've imagined (this is obviously just an offhand example, it's not perfect) then that'd be an abstraction that lets me express al l the details I need (for this particular example) to generate the proper circumstance to write the rest of the program. And that'd be very nice. Haskell doesn't even try to deal with these issues.
>>
>>56617150
doTwice_ a = a *> a *> pure ()
>>
>>56617117
>What the fuck do you mean by this?
Encapsulation involves details in a hierarchy. Composition involves details operating independently on their own but grouped together.
>>
>>56617151
Flaws of Haskell are not necessarily flaws of FP as a whole.

>>56617170
>details of a hierarchy
Inheritance.
>>
>>56617150
>>56617168

doTwice a = (,) <$> a <*> a
doThrice a = (,,) <$> a <*> a <*> a
>>
>>56617134
This is getting tiring.
I have made my arguments, if you want to make your own feel free to do so and I will gladly reply to them. If you keep posting random shit out of your anus I will probably ignore you.
Seems fair enough for me, considering how you have been ignoring every argument I have made for a while now.
>>
I don't think I've ever seen a criticism of FP that didn't boil down to how Haskell in particular does something.
>>
>>56615202
>>56615226
roll and fuck you
>>
>>56617186
>talking about FP in theory
Yes FP in theory can do anything a computer can do.
What's your point?
Fucking zealots man. Never touched a real program in their life.
>>
>>56617206
You've never touched a program either, that's because they're not tangible.
>>
>>56617186
Information in inheritance moves in the opposite direction to encapsulation. You inherit a higher order, less specific body. You encapsulate a lower order body whos specificity is undefined,
>>
>>56617194
>I have made my arguments, if
No you haven't. You've made none. You just ignore what everyone says and tell them their wrong. It wouldn't be so tiring if you sourced even a single claim during the last, what, hour and a half
>>
>>56617206
You're the one who started with "FP is widely regarded as hurtful or not helpful". I'm just following in suit with such a broad claim.

>>56617221
>You encapsulate a lower order body whos specificity is undefined,
Because the details are encapsulated.
>>
>>56617242
>I'm just following in suit with such a broad claim.
No you're not. And you're ignoring the god damned context of the statement. That's the general impression I HAVE of the attitude within the industry.

You're just being retarded, not knowing what encapsulation AND abstraction is.
>>
>>56617151
>these integers are 16 bit
Word16

>avx capable machine with 4 cores and hyperthreading
You can compile Haskell to C or LLVM and do it there, otherwise you could write a library to detect this stuff at runtime using FFI

>alignment, representation
https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Storable.html
>>
Please I want this shit to end. I'm working as a PHP """developer""" now and I can't stand it anymore.

This whole language and business is so inflated, that everybody hires 2$/hr poo in loos doing the job I need to live off and love doing.

My biggest mistake and biggest luck at the same time was choosing PHP as my main language to give me an easy headstart into getting a programming job. But I want to move to something real now.

What language should I learn to be taken serious as a programmer for jobs in a higher pay range than PHP? Right now I'm making 90k / year in Switzerland with 9 years of job experience. I want to have a job suitable for an adult person now. Not deal with kids who know nothing about patterns, best practises or even some programming basics.
>>
>>56617242
>Because the details are encapsulated.
No, because it doesn't matter if the encapsulated body is more specific or not. The specificity of the bodies is independent of the encapsulating body.
>>
>>56617240
>No you haven't. You've made none.
Nice denial

>You just ignore what everyone says and tell them their wrong
I have explained my positions multiple times.

>It wouldn't be so tiring if you sourced even a single claim during the last, what, hour and a half
Most, if not all of them did not need sources.
It's weird to ask me for sources however when literally nobody else did, not even you.

As I said before, waiting for your arguments.
>>
>>56617187
doTwice = arr (\x -> (x, x)) >>> arr (uncurry . liftA2 (,))
>>
>>56617264
What was the point of even arguing if it wasn't your own opinion?

>>56617287
Well, in any case, this has nothing to do with FP at this point.
>>
>>56617274
C# or Java, depending on which is most in demand in Switzerland.

Forget EVERYTHING you know about PHP while you learn C# or Java. NONE OF IT WILL HELP YOU. IT WILL HOLD YOU BACK.
>>
>>56617292
>Nice denial
Right.
>I have explained my positions multiple times.
And they've been debunked several times. Again you can talk as much shit as you want but you're the one who has yet to source his claims. Please source your claims.

>Most, if not all of them did not need sources.
Irrelevant, some of them did. You refuse to do it at all.
>It's weird to ask me for sources however when literally nobody else did, not even you.
Back when this was a discussion about static typing and before you moved the goalpost to some vague claims about C, I did in fact source something. In fact, I've even pointed out several times how you blatantently ignored my source and, to quote myself, it's the single post of mine you have no replied to.

So now not only are you not making any arguments, you're somehow not making any arguments in circles. You can't just accuse me of doing the same to slither out of it, because I've actually sourced myself.
>>
>>56617356
>And they've been debunked several times
I have debunked these so called "debunks" several times.

>Again you can talk as much shit as you want but you're the one who has yet to source his claims. Please source your claims.
You are aware that this exact phrase can been applied to you, right?

>You refuse to do it at all.
I gave you an explanation on why, which you ignored.
>I am unsure how you expect me to prove that something does not exists in the standard. It would be easier if you pointed to me where it exists.
May I ask you however, why do you refuse to tell me where in the standard it says that?

>Back when this was a discussion about static typing and before you moved the goalpost to some vague claims about C
No goalpost was moved

>I did in fact source something. In fact, I've even pointed out several times how you blatantently ignored my source and, to quote myself, it's the single post of mine you have no replied to.
It looks like you have been ignoring what I said
>While replying to a totally irrelevant post, ignoring the rest of its arguments (happens in every post that contains an argument where you are being called out actually) and making no actual contribution.

>So now not only are you not making any arguments
Again, I did multiple times, something that I did not see on your part.

>because I've actually sourced myself
Not once.
>>
>>56617356
>>56617423
Okay, let's finish it.
Just tell me where the standard says that C allows "unsafe access to hardware" and I will admit my foolishness.
>>
>>56617447
undefined behaviour
>>
>>56617463
Not a reply.
>>
>>56617423
>I have debunked these so called "debunks" several times.
When debunking becomes a back and forth you provide sources to settle it. Why is this difficult for you.

>I gave you an explanation on why, which you ignored.
"I explained why I'm not going to verify my claims, how dare you ignore that and not just accept what I say".

>Not once.
Yep, the link to a thesis on static and dynamic typing sure isnt a source.

>>56617447
You keep doing the thing I'm calling you out on. I kind of admire it, but I'm not providing any more sources until you provide at least one. to match mine. I think that's completely fair an reasonable.
>>
>>56617327
>What was the point of even arguing if it wasn't your own opinion?
It's my own opinion as well as my perception of the general attitude.
Why are you making stupid assumptions?
>>56617272
>You can compile Haskell to C or LLVM and do it there
So bascially 'use C'.
Great language anon.
>otherwise you could write a library to detect this stuff at runtime using FFI
Regardless
This isn't about the potential of haskell or the current state of haskell. It's about abstraction and the current state of it. You're obviously getting rid of all of that stuff and having me jump through hoops to get anywhere.
I can't concisely write that in haskell or any language I know of. And imagine trying to do that all over the place. In C that's relatively easy, but detail rich. Usually you make your data end up in that situation rather than expressing that is the case.
That's generally what you'd be saving on with abstractions. You wouldn't have to worry.

I don't see why you FP programmers are so attached to your languages? I hate C. Any programmer should hate his language, it's how they drive forward.

Does haskell interpreters/compilers automatically SIMD-ise stuff yet? If not you should hate that fact. And fix it. Because your langauge (it's really about FP in general) is pretty perfect for it.
>>
>>56617485
So you were trolling all along, I see...
>>
>>56617485
>pretending to be retarded
Nice anon. Nice. A classic. I'l take a picture and put it in my scrapbook.
>>
>>56617447
so you don't have to provide any source no matter what but he does?
>>
>>56617523
See >>56617423
>I am unsure how you expect me to prove that something does not exists in the standard. It would be easier if you pointed to me where it exists.
Moreover he is the one who whines about sources.
>>
>>56617522
>>56617501
Nice samefagging laddo. I've provided one source for my claims. I want one in return. You don't get to pretend to have any high ground until you do. One sourced claim >>> every single statement you've made. Join a college or professional debate team and try make the arguments you're making while indignantly refusing to provide your sources. You'll be immediately removed.
>>
>>56617496
>so basically use C
>great language

You asked to make it FAIL TO COMPILE on certain platforms
Normally, you'd just NOT COMPILE IT for those platforms
>>
>fp sucks because haskell can't do thing
>actually haskell can do thing
>lol haskell fanboy this is how stagnation happens
>>
>>56617549
No you're just being retarded so multiple people can see it.
>>
>>56617542
You think that by focusing in on a single negative claim you can convince people to ignore the dozens of others. You remain the only side in this argument without a single source for a single claim
>>
>>56617567
You keep doing the same thing. Ignore the argument and demand from others what they request from you, while getting offended by the request.
>>
Whatever argument is going on has gone so far off the rails that I have no idea what they were originally disagreeing on- they might even disagree on what they're disagreeing on...
>>
>>56617563
Yeah. but it's important to know the platform isn't AVX so you don't get horrendous performance and don't know what the fuck is going on.

Imagine the support issues when people are reporting the program as ~1/4th the speed and there can be just about any bug.
>>
>>56617591
It doesn't even matter, that stopped being a thing ages ago.. I just want him to source any claim he made. Anything at all.
>>
>>56617598
Maybe document it?
>>
>>56617591
There's multiple arguments. One is against a troll.

But any argument is constructive as long as it's actually concerning something. Which these are.

Well spent time? Probably not.
>>
>>56617598
GHC is a compiler, not a make system or an IDE
>>
File: 1465498943358.png (4KB, 164x51px) Image search: [Google]
1465498943358.png
4KB, 164x51px
>>56617549
>Nice samefagging laddo
Nice fail

>I've provided one source for my claims.
Should I quote myself again because you keep ignoring what I said? Ah, nevermind, I forgot that you were trolling and that it would go to waste.
Here goes nothing however, for the last time.
>While replying to a totally irrelevant post, ignoring the rest of its arguments (happens in every post that contains an argument where you are being called out actually) and making no actual contribution.
You simply linked a pdf that did not justify any of your arguments to a totally unrelated post. This is not a source.

It would seriously be nice if you stopped ignoring my arguments and actually reply to them however.

>>56617568
What?
>>
>>56617613
No obviously you write two versions of the program where one is adapted for AVX machines and one is for whatever alternatives you wish to support.
This is obvious stuff why am I explaining this?
>>56617627
Doesn't matter. He supplied a solution that doesn't fit the problem then.
Why do you people do this? I'm not asking for GHC to do anything I'm asking for language capabilities.
>>
How come functions which you override in kotlin don't inherit their parent docs?
How do I make the IDE inherit them?
>>
>>56617549
Nice fail there anon
>>
>>56617632
>Should I quote myself again because you keep ignoring what I said?
What does that even mean. My source is in this thread, and has been since I posted it. You can look at it whenever you want. You have no sources.
>>You simply linked a pdf that did not justify any of your arguments to a totally unrelated post.
I linked a thesis, and the second link posted, explaining what static and dynamic type systems are, because that was the original argument. Any other document would have the same definitions. At some point you changed the argument to some weak claim about c. At no point in any of that did you so much as provide a yahoo answer (which frankly would have more credibility than you at this point. I've actually seen citations used on yahoo answers)
>>
>>56617659
Let me get this straight. Your whole argument against FP as a whole being efficient is that Haskell can't enforce code that uses AVX to only be compiled for platforms with AVX.
>>
>>56617611
You can't demand sources from others for
1: stuff that does not need sources (logically connected arguments)
2: stuff that can't be sourced (such as the lack of something in a standard)

And you can't demand others to give you a source when you have
1: Ignored every single one of their argument, especially when you post unrelated shit as replies accusing the person in the question
2: You keep demanding sources when you do not provide any on your part

If you want a specific one on my part, tell me, I might be able to give it to you.
>>
>>56617701
>1: stuff that does not need sources (logically connected arguments)
>2: stuff that can't be sourced (such as the lack of something in a standard)
You can't just decide those are the only two source worthy claims across two threads.

>If you want a specific one on my part, tell me, I might be able to give it to you.
I've already explained this about five times. I don't want a specific source, it's too late for that. I want you to source ANYTHING or just admit you don't have any sources(or don't care enough about what you know to try and find one, but then why would you waste an hour trolling the issue). You;ve made a lot of claims and counter claims and have no evidence for any of them.
>>
>>56617496
>You're obviously getting rid of all of that stuff and having me jump through hoops to get anywhere.
What are you talking about?
>>how do you do X specific thing in Haskell?
>use this built in library
>>wtf hoop?!

>I can't concisely write that in haskell or any language I know of. And imagine trying to do that all over the place. In C that's relatively easy, but detail rich. Usually you make your data end up in that situation rather than expressing that is the case.
the main usages of Haskell do not include forcing it to not compile on certain platforms

>I don't see why you FP programmers are so attached to your languages? I hate C. Any programmer should hate his language, it's how they drive forward.
It's obvious that you're mad why FP programmers love their languages. It was a genuine pleasure to move to something like Haskell, and makes writing code a lot nicer. Low level details are one of Haskell's weaknesses, but it's not "because of abstraction", it's because that's not what it was made for. You could create abstractions for low level details in Haskell.

>Does haskell interpreters/compilers automatically SIMD-ise stuff yet? If not you should hate that fact. And fix it. Because your langauge (it's really about FP in general) is pretty perfect for it.
You will actually find here, a library for GHC (not included in base, but still by GHC) that contains a great deal of primitives.
https://hackage.haskell.org/package/ghc-prim

https://hackage.haskell.org/package/ghc-prim-0.5.0.0/docs/GHC-Prim.html
>>
>>56617659
>I'm asking for language capabilities.
GHC is the de-facto main Haskell compiler, the people that write and work on GHC include those who write and work on Haskell
>>
>>56617683
>What does that even mean
It's clear

>My source is in this thread, and has been since I posted it. You can look at it whenever you want
Another proof of you ignoring everything that I said.

>explaining what static and dynamic type systems are, because that was the original argument
And these were totally unrelated to the post you were replying to. Not to mention that you posted no argument in that certain post so it backed up nothing.

>>56617741
>I want you to source ANYTHING
Okay, now I am sure that you are trolling.
If you want a source, ask for somethign specific.

>You;ve made a lot of claims and counter claims and have no evidence for any of them.
You;ve made a lot of claims and counter claims and have no evidence for any of them.
>>
>>56617803
"I know you are but what am I".

No matter what you say, only one of us has even attempted to source our claims. I'm glad that you've accepted you're trolling but I'd prefer if you stopped now.
>>
>>56617000
>when you try to go to another language and its type checker starts yelling at you you'll think "this is shit, why would anybody use this, Python is much better"
This is like the A-#1 argument that's used here but I've NEVER EVER heard anyone worth interacting with say that ever. Even the intern at my workplace who only knows web languages had no problem moving to Java (and subsequently C#) while he was here. People who actually end up saying "why isn't this exactly like Python" don't actually stick around the whole programming thing for long; they're the same kind of people who end up dropping introductory and CS 1 classes because it's not the glitz and glory that's been promised to them by plebbit kiddies and webshits.

>Python encourages sloppy code, not thinking too hard while writing it
Once again, not taught from textbooks.

>and figuring it out later by spamming tests
Webshit bootcamper-tier. Can't fix stupid.

>A decent statically typed language does the opposite
>It is impossible to write sloppy code with little thought put into it merely because the language is strongly typed
This is exactly what you're saying.

The entire "bad habits" issue boils down to proper learning and not using shitty materials. Python works as an ease-in language and is pretty valuable post-learning but retards and webshits insist on """teaching""" it by throwing shitty print statement examples, frameworks, and syntax practice at the learner instead of doing things traditionally by teaching HOW one identifies a problem, constructs a solution for it, and WHY this process applies globally despite being taught in Python.
>>
i am making an antichess AI in C
have to add pawns, which are annoying because of promotion
i think ill just ditch an passan or however you spell it in french, doesnt happen that often in antichess

then just the alpha beta search and m done
>>
>>56617829
>only one of us has even attempted to source our claims
Which happens to not be you, considering that you refuse to reply to something where you claim that you have a source for.

>I'm glad that you've accepted you're trolling
Yet another proof that you are trolling.
I accepted no such thing.
>>
>>56617747
>it's a library
Looking at the interface makes me question why I'm not just using intrinsics. And why haskell doesn't use the CPU features available on the platform.
What other instructions does it not use by default.

It doesn't seem like a joy to move to haskell. Seems like a large cumbersome project of evaluating the aptitude of the environment.
>>
>>56617865
>considering that you refuse to reply to something where you claim that you have a source for.
Which is?
>Yet another proof that you are trolling.
"I know you are but what am I".
Is that literally what you've devolved to man?
>>
>>56617900
>Which is?
"unsafe access to hardware"

>"I know you are but what am I".
Nope
>>
>>56615202
Rollan
>>
>>56615202
rolling stones
>>
>>56617912
I never claimed to have a source for that actually. Whether or not it's in the standard I'll find out later. I'm not afraid to admit I may well have been wrong to say that, and I am not the one hung up on it. It's also a single line in a single post. You've spouted nothing but bullshit and have been dangling that bait over and over to avoid sourcing any single claim of yours(literally...anything, pick one statement you made that was contended by me or someone else and source it).
>Nope
Every time I've accused you of something you've just used the same accusation back to avoid addressing it. That's the definition of "I know you are but what am I"
>>
>>56617865
>>56617900
>>56617912
>>56618001
Holy fuck, you gals are both insufferable faggots.

You're not even talking about programming at this point. You're just bitching at each other.

>>56615154
>What are you working on, /g/?
I'm writing something that's going to make a lot of money in various gray areas of legality.
>>
It's the same guy that tried to get others to spoonfeed him yesterday on the "webm to mp4" topic.
>>
>>56618032
>You're not even talking about programming at this point. You're just bitching at each other.
I just want to learn :(
>>
File: harpy.png (19KB, 373x490px) Image search: [Google]
harpy.png
19KB, 373x490px
>>56617896

The library I linked provides access to the primitive operations GHC uses in its code generation. They are replaced with the relevant LLVM or assembly code when you use them.

If you want to use low level operations locked to specific platforms, Haskell is not the language for you. If you want to use low level operations, you will normally not have a nice interface.

Haskell is very nice for writing EDSLs in though, so you could quite happily embed something that looked like ASM in it, and create functions to assemble and run it.
There are examples like Harpy for instance.
>>
>>56618043
Thanks based janitor.
When will we get forced IP based ID's?
>>
>>56615301
Meh, you're overengineering it...

My stab at it:
defmodule FizzBuzz do
def run(n) do
Enum.map(1..n, fn(n) ->
case {rem(n, 3), rem(n, 5)} do
{0, 0} -> IO.puts "FizzBuzz"
{0, _} -> IO.puts "Fizz"
{_, 0} -> IO.puts "Buzz"
{_, _} -> IO.puts n
end
end)
end
end

FizzBuzz.run 100
>>
>>56618043
which?
>>
>>56618068
Janitors can't see IPs.
>>
>>56617481
Undefined behaviour can be anything, including unsafe access to hardware
>>
>>56618120
If you also consider "C fucks your mother" as a true statement due to undefined behaviour then sure.
>>
>>56618120
C doesn't interface with hardware unto itself when running in userspace...
>>
>>56618120
>>56618145
Has /dpt/ just regressed into the programming equivalent of existential nihilism?
>>
>>56618066
>if you want to be platform specific haskell is not for you.
OK. If FP-languages in general are like this then that's probably what brought the FP isn't helpful attitude within the games industry. I don't know. I just found it very cumbersome to actually try and get things done efficiently in my own experience and concurred with most opinions. Assuming FP doesn't do platform specific stuff conveniently then I don't see why morons are arguing with me about this.

But how do you expect to get anywhere as a if you can't do platform specific code conveniently? You will just die like everyone else who tried.
>>
>>56618043
>"webm to mp4" topic
I gotta hear this one.
>>
>>56618213
Some moron doesn't know there's lossless h264. He asks /dpt/ about how to convert losslessly from webm to mp4. Assumes ffmpeg is the only conversion tool. People call him out for not going to sqt and being retarded and he cries.
Nothing special.
>>
>>56618032
>I'm writing something that's going to make a lot of money in various gray areas of legality.
sounds fun. details..
>>
>>56615241
Build stuff and try to incorporate something new about Computer science each time. Go back to old projects and tweak them.
>>
>>56618202
Not him, but there's nothing about the idea of FP that goes against this at all. Haskell is just one language. You don't even need a new language to get a lot of the benefits of FP.
>>
>>56618240
>Nothing special.
True. One in every crowd.
>>
>>56615202
Rolling.
>>
>>56618202
This is Haskell specific, I can't speak for other languages.

>FP isn't helpful attitude within the games industry
The games industry never really tried FP*, though there are performance issues with languages like Haskell that would make it impossible to write a triple A game in (GC, for a start), ocaml doesn't necessarily have this problem. I've also heard it's hard to reason about space in Haskell, it can use up a lot of memory because it's lazily evaluated.

You could almost certainly use Haskell as something like a scripting language for a high performance game though. You couldn't write an engine in it.

*there have been lots of functional things moving into non-functional and "multi-paradigm" languages, and as another anon said use of callbacks is pretty functional.

You don't need to do platform specific stuff all the time, even to get good performance. It has built in parallelism and concurrency libraries, the code generator can decide whether to use AVX or not.
>>
why cant anime program
>>
ITT: People that need to understand the difference between kernel mode and user mode.

>>56615154
Trying out a fun multithreaded application design.
>>
File: double compile!.jpg (20KB, 400x300px) Image search: [Google]
double compile!.jpg
20KB, 400x300px
>>56618349
>>
>>56618349
You should really be asking why we can't program anime.
>>
File: wallplug.webm (2MB, 960x706px) Image search: [Google]
wallplug.webm
2MB, 960x706px
>>56615154
I cannot choose the language that I should use for my pass manager project.

It will have a GUI so I am thinking C#, Java or Qt, but I don't want to use C# for everything so I try to leave it alone now.

I will use an xml file to store the data so, again, C#,Python or C++. I refuse to parse xmls with java so that is not an option. Python would be greate, but designing the UI would take time.

So my choice would be either C#(again) or Qt, which I am not familiar with.
>>
>>56618413
Haskell
>>
>>56618250
Why are you telling me this information?
Was this meant to be a standalone post? Nobody needs to hear this.
>benefits of FP
You say that. But favoring pure functions is something anyone worth their salt is already doing. The paradigm is more than that though. And without proper tools that reason well and generate code well it's useless. Its just not reality right now and favoring a paradigm without practical application is foolish.

>>56618294
>the games industry never tried FP
Bullshit. There's been plenty of excursions into FP with games and the situation below (as scripting languages) is the extent it goes to. But that's not saving time for the expensive people.
>scripting language for a high performance game
People avoid this for a reason.
>the code generation can decide to use SIMD or not
But the fact that I got told it does so using libraries makes me question if it actually generates using those instruction sets. Why don't people just tell me 'yeah it happens sometimes but it's wonky' or whatever? That's leagues better than having to use a library.
>>
>>56618360
You are a retard
>>
>>56618413
Are you wanting to practice C++ or just get it done?

C# would be the most efficient option if that's what you're familiar with.
>>
>>56618413
Well, it's all about what you get out of it. Need it for school/work? C#. Own personal benefit? Qt.
>>
>>56618413
I did pyqt. Its pretty ok.
I'm questioning why you're spending so much time thinking about your choices when the answer should be obvious.
>>
>>56618413
You just described a situation that c# is perfect for, between wpf for the gui(or forms if you want some kind of compatibility with mono) and a mature linq based xml parsing library. I think QT# is a thing as well but I'm not sure
>>
>>56618429
>Bullshit. There's been plenty of excursions into FP with games and the situation below (as scripting languages) is the extent it goes to. But that's not saving time for the expensive people.
That's not remotely true.
The overwhelming majority of games programming has been in C derivatives.
The only places you hear about Scheme, Ocaml, Haskell etc games is on Scheme, Ocaml, Haskell etc forums

>people avoid this
Haskell isn't a scripting language (it's a compiled language) I'm saying you can use it for scripts. Most if not all AAA games will use scripts somewhere. Skyrim had tons of scripts, dragon age does, etc. So certainly RPGs if not other games.

>if it generates using those instruction sets
You can have this issue with any compiler.
>Why don't people just tell me 'yeah it happens sometimes but it's wonky' or whatever? That's leagues better than having to use a library.
If you use the built in concurrency library then it's a lot more likely to do it, but the library I linked to you before was not "just" a library, it contained definitions that are primitives to the code generator
>>
>>56618542
Eh there's lots of games in fp but they're generally indie/internal and proof of concepts.
>>
>>56618561
Exactly, that's not a real attempt at FP.
And I hope you don't consider languages like Python to be functional
>>
>>56618584
I'm not the lad you've been responding to. Just adding a couple of cents
>>
Daily reminder that procedural languages with functional features are superior.
>>
Daily reminder that undefined is not a function
>>
File: ourjesus.jpg (104KB, 635x793px) Image search: [Google]
ourjesus.jpg
104KB, 635x793px
>>56618453
>>56618460
>>56618517

Yes, I know that C# would be the best of all, but as I told, I try to kicked that addict. I have been used C# for a lot of projects recently, it is so comfy.

Therefore, Qt is on the menu now. Or should i make separate lesser programs that work together? So a GUI program(in Java) that receives the requests and then it sends the commands to the xml "librarian"(console:Python) via messages and that would do the actual job? So a client(gui program) and a server(console) based project?

Maybe I just "overcook" this whole thing..
>>
>>56618730
Ah if you're looking to expand beyond c# I'd say qt is a fine choice for a project. Have you considered f# instead, for the comfiness of c#.net and the skills that come with learning a new paradigm?
>>
>>56618669
I don't get it, I can call it?

#include <stddef.h>

int main(void) {
void (*f)(void) = NULL;
f();
return 0;
}
>>
>>56618542
>not even remotely true
If you ignore what my post said. Yes that could be a valid opinion.
>haskell isn't a scripting language
I didn't say it was. Read again. But as a scripting language (when you say this in context of games the point of the language is to allow for quicker iteration than the engine language) for games it should be able to be altered to be fast relatively easily and it should probably have runtime code changes be possible. You see this with blueprints in UE4 or their older (UE3) action script for instance.
>you can have this issue with any compiler
Yes. Of course, but why does haskell do this? How can people post at me encouraging FP use in games when it can be done so easily in haskell yet it isn't being done. Its clearly not ready for any performant development.
>concurrency library does this
Uh I hope not. That'd be horrible. Concurrency shouldn't be confused with vector instructions. Someone should fix that then.
>>56618584
What is even this post. Why is python being brought up? Lua is the goto scripting language games tend to use.
>>
>>56617496
>Any programmer should hate his language, it's how they drive forward.
#shitreddtisays
>>
>>56618413
You can use Python with Qt just fine. The Qt binding for Python lets you load the .ui files so you can create the interface with drag & drop and load it with Python w/ no problem.
>>
>>56618784
>Lua is the goto scripting language games tend to use.
That reminds me, what's /g/s opinion on learning lua
>>
>>56618814
Why does that matter?
It's a very simple language. Why waste time contemplating.
>>
>>56618805
I always used the utility that converts the .ui to Python code. Are you talking about this or is there something else?
>>
>>56618830
Because between the shills, the neutrals and the assholes I'm hoping I'll learn some interesting things about lua that might pursuade me to learn it when I'm finished my current project. Sometimes shitposting is the best way to learn
>>
>>56618771
It's a JavaScript joke.
>>
>>56618868
No, I'm not talking about pyuic utility, you can import uic fom the Qt library and use that to load the .ui file in the class.
>>
>>56618784
>If you ignore what my post said. Yes that could be a valid opinion.
If you ignore what my post said. Yes that could be a valid opinion.

.>Read again. But as a scripting language (when you say this in context of games the point of the language is to allow for quicker iteration than the engine language) for games it should be able to be altered to be fast relatively easily and it should probably have runtime code changes be possible. You see this with blueprints in UE4 or their older (UE3) action script for instance.
Haskell can be changed and iterated easily

>Yes. Of course, but why does haskell do this? How can people post at me encouraging FP use in games when it can be done so easily in haskell yet it isn't being done. Its clearly not ready for any performant development.
I guarantee you that 90% of games programmers are not directly inserting asm for AVX SSE and SIMD and then telling their compilers only to run on 4+ multicore hyperthreaded processors.

This is an incredibly niche use case - no doubt one used in triple A games engines (- by lead programmers), but not one that's common for programmers. Your incessant need to try to drive this single point in is clearly that you need to find some fault. It is ridiculous to say that because you cannot tell it "only compile on AVX platforms" that the language is somehow therefore immature.

Is C immature?

>Uh I hope not. That'd be horrible. Concurrency shouldn't be confused with vector instructions. Someone should fix that then.

Whoops, I meant Control.Parallel
https://hackage.haskell.org/package/parallel-3.2.1.0

>What is even this post. Why is python being brought up? Lua is the goto scripting language games tend to use.

Lua is not a functional language.
>>
>muh no generics in Go
https://blog.golang.org/generate
it's ugly, but it works.
>>
>>56618957
Ah yes, such an improvement over preprocessor macros.
>>
>>56615883

>and fuck Ruby

I take it you have never tried Ruby?
>>
>>56619005
>OOP language
Immediately dropped
>>
>>56618932
Cool
>>
>>56619016

It's OOP done right, anon.

Not the "AbstractBeanEaterFactory" type of OOP, but the smalltalk type of OOP..
>>
>>56619048
>OOP done right
Not at all?
>>
new
>>56619068
>>
>>56619059
>>OOP done right
>Not at all?
Smalltalk
>>
>>56619094
Notalk?
>>
>>56618947
>I assure you
I assure you that's approximately what's happening.
>if you ignore what my post said
Well you took my specific circumstance which I mentioned and pretended it was a general statement.
>>
>>56618814
has no use for it.
maybe I'll use openresty (nginx+luajit) when I need some high performance web server proxy with scripting power.
>>
>>56615202

Rolling..
>>
File: 1368721320239.jpg (177KB, 480x640px) Image search: [Google]
1368721320239.jpg
177KB, 480x640px
what should i learn g
rust, go, c, or c++
>>
>>56615894
kek
Thread posts: 331
Thread images: 13


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.