/dpt/ - Daily Perentie Thread

What are you working on, Sup Forums?

Previous thread:

Other urls found in this thread:

tour.golang.org
golang-book.com
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=ghc
twitter.com/NSFWRedditGif

First for C#

Second for C++

nth for why arent you working on that project, /dpt/?

Interfacing SDL2 for OCaml.

>OCaml
Such a practical language, the official implementation can't even do multicore yet

>the official implementation can't even do multicore yet
absolutely embarrassing

And? I see no problems here. It will come, or not. But it's useless. Look at what JaneStreet does.

I'm a lazy piece of shit.

This is fine.

"multicore is useless"
-/dpt/
off to a good start.

Post a better string reversal in C.
void reversal(char* r){
size_t len = strLen(r);
char* f = r+len-1;
for(;r

>we are incompetent and cannot make compiler that support native threads
>BRO just spawn another process, like dude who needs threads when operating system can manage proceses LOL.
yeah fuck ocaml

>it's useless
Incredible, we found a language more useless than Haskell!

How to troll /dpt/ in a nutshell.

Not having multicore works for Python, and as we all know Python is the best language because it just works

C influenced languages get an automatic F in my book.

D was robbed. D is far more useful than OCaml will ever be, and yet it is dead.

>strings in his favorite language aren't mutable

D is shit

whoops

D was shit

...

Who the fuck thinks Ocaml is relevant?
Its even lower on github stats than D.

#!/bin/sh

set -e

i=1
while [ $i -le 100 ]
do
if [ $((i % 15)) -eq 0 ]
then
echo "fizzbuzz"
elif [ $((i % 5)) -eq 0 ]
then
echo "buzz"
elif [ $((i % 3)) -eq 0 ]
then
echo "fizz"
else
echo "$i"
fi
i=$((i + 1))
done

>Who the fuck thinks Ocaml is relevant?
OCaml is the future. People start slowly to realize it.

I am working on documentation for a project. Why is texinfo so comfy?

>D
>useful

When will the K&R bracket indentation meme die, /dpt/?

I hate my coworkers who are autistic about CRUD forms not being properly aligned, not having the right number formatting, input labels not having colons, etc. They take bikeshedding to the extreme.

The user making an SDL2 interface for it evidently does.

>OCaml is the future.
Not with that god awful syntax its not.
Its not even a good functional language.
And even D is a better functional.

OCaml is impure trash

The future is multicore.

OCaml does not support multicore.

It will, just be patient. And right now, what are you doing that need multicore and can not be done with multiprocesses?

Idris > Haskell > Scala > OCaml

too lazy, and I'm already taking decisions about its design. that makes me anxious...

hey, how are you doing, you libertarian-statist-religious-transexual-racemixer?

2.9G ./gcc
2.8G ./linux


w-what... gcc repo bigger than linux repo?

i am working on it

this is a fact

>It will
It won't in our lifetime.

which should i learn: common lisp or haskell?

>It will, just be patient.
Or, just use a language that has had solid multicore support for years, i.e. almost any other language in use today.

Hopefully right now.

Facts: The odd of using OCaml increase with developer skills.
The odd of using C++ decrease with developer skills.

It's just a matter of time.

scheme and idris

learn Go
tour.golang.org
golang-book.com

i-i want to write real software though...

>Idris > Haskell >= Scala = OCaml
ftfy

Facts: after a certain point, the odds of learning ocaml decrease with developer skill and the odds of using idris increase with developer skill

haskell then idris

tfw to intelligent to use a language that supports multicore

Facts: You are homo. Ocaml doesn't currently support native threads. Even if it got it implemented now it would still takes years to mature.

What is an ``functional language" though?
What is an ``real software"?

literally what is good about ocaml

Haskell is strictly superior to Scala
Scala is strictly superior to OCaml

Haskell is strictly superior to Go

He might as well just skip Shitkell altogether.

Purity + fast production with HOF.

>literally what is good about ocaml
No stupid shadow warning.
No implicit recursion.
Type inference.
Pattern safety.
Fast.

>What is an ``functional language" though?
A language that is not a dysfunctional language

Dysfunctional languages include Python, Go, and JS

>Haskell is strictly superior to Scala
I don't know about that, user. They seem very much the same to me.
>Scala is strictly superior to OCaml
Scala and OCaml can be shown to be the same language.

that's dumb advice

More wealth is created using OCaml than several languages with more "open source" présence. Including D.

Should I learn perl or shell script?
I know shell script use glibc runtime.
What does perl use?Also my company, NVIDIA wants me to learn perl.
But for my personal use which would be better?

>Purity
Purity as in "Purity" or Purity as in ``````purity"""?
>fast production
In what units do you measure these ``productions"?

void reversal(char *r){
size_t len = strlen(r);
for(char *f = r + len - 1; r < f; r++, f--){
*r += *f;
*f = *r - *f;
*r -= *f;
}
}

That's for the best, though.

It's cute but it's not especially readable.

Shell. Useful all around, but knowing a bit of perl (especially the regex) can help quite a lot. Especially the one-liners.

>Should I learn perl or shell script?
Is it a true question?

>They seem very much the same to me.
Pic related doesn't happen in Haskell. Also Haskell has much better type inference and stack safety.

>Scala and OCaml can be shown to be the same language.
Scala supports multicore. OCaml does not.

Should really change the title to /dlf/ - Daily Language Fight.

But the question is, are you a ```````````````````````````````````````````````programmer'''''''''''''''''''''''''''''''''''''''''''''''?

>dysfunctional language
What is an ``dysfunctional language"?
>Dysfunctional languages include Python, Go, and JS
I need a full list or an algorithm for generating that list.

hmm u just made C++11 relevant

>présence

INRIA shill pls go

die kike

Yes, asking it.

I actually worked for Inria at some point. We used sepples though.

void reversal(char *r){
for (char *f = r + strlen(r) - 1; r < f; r++, f--)
{ *r += *f; *f = *r - *f; *r -= *f; }
}

competition breeds progress.

Learn shell, and avoit spending time on perl. There are a ton of more useful things to learn, like OCaml or Coq or Haskell or...

>inria itself doesn't even use its garbage language

You're so wrong.

kek

>comparing only based on a single performance metric
by that logic, C >> *
also,
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=ghc

Rate my code, /dpt/

int64_t fibonacci(uint8_t n)
{
if (n 92) return -1;
n -= 2;

uint64_t a = 1, b = 1, c = 0, d = 1, e = 1, f = 0;

while (n) {
uint64_t g, h;
if (n & 1) {
g = a * d + b * e;
h = b * d + c * e;
f = b * e + c * f;
d = g;
e = h;
}
g = a * b + b * c;
a = a * a + b * b;
c = b * b + c * c;
b = g;
n >>= 1;
}

return d;
}

>linking to the rigged benchmarks

>C >> *
Is this even wrong though?

It wasn't really the appropriate domain (medical simulation).

stop avatarfagging this instant

>no xor swap

>pidigits
source secs mem gz cpu cpu load
Go
0.13 ? 603 0.13 0% 0% 0% 100%
Haskell GHC Make Error


>the state of hasklet

That was a reaction image.

Fair enough, for that stuff you want code that you can prove correct

i know your game

Nice O(logN) complexity you got there :)

Yes, C++ is faster when you're sorting.

xor swap isn't really efficient (most compilers detect an auxiliary variable swap and just replace it with XCHG instruction).
also, it can fail if you xor the same value (same address), and that could be the case here because
r

just make one sort function per type

There are 100 bulbs and switches in a room.
There are 100 fags.
1st fag toggles all the switches.
2nd fag toggle multiple of 2 numbered switches.
.
.
rth fag toggle multiple of r numbered switches.
100th fag toggle only 100th switch.
At the end of this experiment. How many bulbs are switched on?Assume your own initial state of bulbs.

idgaf

>faggot doesn't provide the initial state of the lights

let print oc = function
| [] -> Printf.fprintf oc "0"
| l ->
let l = List.rev l in
List.iter (Printf.fprintf oc "%d") l
;;

let add l1 l2 =
let add_digit a b c =
let n = a + b + c in
n / 10, n mod 10 in
let rec loop accu carry l1 l2 =
match l1, l2 with
| [], [] ->
if carry > 0 then
carry :: accu
else
accu
| l1, [] -> loop accu carry l1 [ 0; ]
| [], l2 -> loop accu carry [ 0; ] l2
| x1 :: l1, x2 :: l2 ->
let carry, n = add_digit x1 x2 carry in
loop (n :: accu) carry l1 l2 in
List.rev (loop [] 0 l1 l2)
;;

let rec fib a b = function
| 0 -> ()
| k ->
Printf.printf "%a" print a;
print_newline ();
fib b (add a b) (pred k)
;;

let () = fib [] [ 1; ] 100;;