/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?
Old thread:

Other urls found in this thread:

kotlinlang.org/docs/reference/delegation.html
github.com/thibaultduponchelle/x86-64-cgi-assembly-hello-world
en.wikipedia.org/wiki/BusyBox
lights-of-holiness.eu/android/
tapoueh.org/blog/2014/05/why-is-pgloader-so-much-faster/
twitter.com/NSFWRedditVideo

First for anime.

fuck opengl

Reminder that x86 is the simplest instruction set and therefore nothing can possibly be faster than it.

Rust

>More fancyful instructions would make the hardware perform worse not better.
Having GC being in software means it optional and can be circumvented for performance reason.
That's only assumption, though it would interesting to create simulation and benchmarks with done either in software or maybe even with fpgas to test this out. Too bad nobody will ever make those tests.

>That's only assumption
So stop stating it as fact.

>zero-"cost" abstraction

>wants to be a girl
>uses an ugly system programming language instead of a cute scripting language

I'm interested in last thread's conversation
here we go again

>name the least verbose language that's as powerful as C++

the second line didn't get quoted because the original faggot had newline there.

Powerful in what sense?

daily PHAGGOT thread amirite xD

good performance, can be used for any applicatio.

ATS2, but how do you define "verbose"?

C

>he insists on calling zero cost abstraction what are in fact zero overhead abstraction
Low IQ test succeeded!

VHDL

CL

Can't think of any tbqh

ats is pretty terse, though

a non-verbose language is:
>easy to learn
>straightforward does not require workarounds and stuff like that
>have to type less
>easy to read
Basically like Pascal or something
no.

C meets you definition, idiot.

vhdl is verbose as fuck. Also it cannot describe high level language constructions, they wouldn't even map well to hardware.

Your only choices are C, C++ and Rust. Pick your poison.

Go

>good performance
>rust
>>>/reddit/

away

Compare C to ruby and rethink your post

EL GENERICOS

>>easy to learn
>>straightforward does not require workarounds and stuff like that
>>have to type less
>>easy to read
Go, if you can take the performance hit of ~2 x C.

>>>/tumblr/

>singular artical
>plural noun

Assembly

This is my favourite feature from Kotlin:

kotlinlang.org/docs/reference/delegation.html

What weirds me out though, is that it only works because of the somewhat limited class/inteface model. You can't really have that feature if you have more advanced cases like typeclasses with return-type polymorphism, or if you have multimethods. The automated interface implementation works solely because JVM interfaces are less powerful than interfaces in some other languages.

>type less

>if err != nil everywhere

>handling errors

how do i webdev in assembly

Nim.

Or D, depending on what you mean by "powerful".

yet another ad-hoc limited solution to a problem even when a better, more general solution is already known

yet another shitlang

I installed Julia but my antivirus is bitching about some file inside the install folder called busybox.exe. Googling it brings up no results, does this happen for anyone else? I'm one of those horrible winlets so I'm using the windows installer binaries(64 bit). Sorry. At the very least it's not by preference.

>D
elaborate, is D as good as it's being shilled here?

Why are you using Windows?

Why are you installing Julia?

>resident autist at work insists on using his own algorithms even though a brainlet like me can write a proof that his algorithms are shit and he should stick with ones that aren't his n^2 abominations

no

github.com/thibaultduponchelle/x86-64-cgi-assembly-hello-world

>he insists on declaring his subhuman nature once again after getting BTFO in the previous thread
Reminder that a perspective shift has no cost. Double-digit-IQ animals like you just don't understand what an abstraction is.

it's dead

I had an issue with the latest version of Julia giving me a windows defender warning because some file inside wasn't signed. Didn't get the same for earlier versions.

I assume some of the people who packaged up the 0.6.1 bugfix version screwed up and forgot to digitally sign all the files.

>what an abstraction is
something that costs performance

WASM

en.wikipedia.org/wiki/BusyBox

Common Lisp

or the actual production ready successor: Python

>something that costs performance
Use of an abstraction need not incur a performance penalty.

>((((Common Lisp))))

fuck off

Python doesn't have a switch statement

It's good if you want something with all the features of C++ without any BS.

Rust is also a better C++, but it drops some features that are viewed as mistakes, and it makes no real effort to not be verbose, instead focusing on being a systems language. The question asked for "least verbose".

Nim is even less verbose than D and has similar design choices and C/C++ compatibility, but is more different from Sepples. It's also "up and coming" rather than dead.

OKAY FOOLS, you can stop making your web apps with your meme languages now!
Common Lisp has QT5 bindings and can deploy to all platforms that QT supports.
lights-of-holiness.eu/android/

More like: Uncommon Lisp :DDDDD

Isn't Nim a GC lang?

switch statements are not expressive enough and thus removed

i feel meaningless today so i wrote a piece of code to reflect my feelings and i'm just letting it run.
n = 1
while 1:
print(n)
n += 1

>mad about the truth

((((((((((((:DDDDDDDDD))))))))))

I'm gonna use a heap as a priority queue. I want to set level of priority but at the same time want to prevent starvation of nodes waiting in the queue by wait time. How do I properly age a node in the queue so that it bubbles up to the top?

It's a cousin of ML, what did you expect?

>easy to learn
I mean, technically. If there were decent tutorials and manuals, it would be, but some concepts are inherently harder to learn because they're not part of your average programmer's toolbox (linear types come to mind).
>straightforward does not require workarounds and stuff like that
Sure.
>have to type less
Define "type less." If I want to prove correctness inside the language itself, is it typing less, considering I won't have to fix bugs? How about existential and universal quantification?
>easy to read
No, and good luck finding an easy-to-read language for everyone.

This is an example from list.dats in Prelude, reformatted not to be in Xi's eye-cancer style.
fun loop { l: int | l0 res(l)) : void = (
if (l < r) then
let
val () = res := list_vt_cons{elt}{0}(l, _)
val+ list_vt_cons(_, res1) = res
val () = loop(l + 1, r, res1)
prval () = fold@(res)
in
end
else
res := list_vt_nil()
)

so i'm stuck with a bunch of if else statements?
no

ats's syntax really is the second ugliest, only language uglier than ats is rust.

common lisp is a dusty old lego set that rarely gets played with any more

python is a fresh steaming turd

>tfw had a dream last night that was entirely in Rust
>tfw it was a program that would tell you if you were going to race mix or not
>tfw the dream wouldn't compile because it was unsafe

>lisp is dead
of course, python is better than lisp in every way

>l: int | l0 res(l)) : void = (

>val () = res := list_vt_cons{elt}{0}(l, _)
>val+ list_vt_cons(_, res1) = res
>val () = loop(l + 1, r, res1)
>prval () = fold@(res)
nigger this is the worse thing i have ever seen

and by the way Ruby checks all user's criterias.

FreeBASIC. Compiled with GCC frontend. Has struct-like objects with constructors and methods.

i'm a little late but i'm not even sure what you're doing.

you can't initialize non-static structures or classes outside of functional context, and you have two separate files which both would require execution context to compile(a.cpp has assignment, b.cpp dereferences assigned value of a non-static struct instance).
could it be that you're trying to set a new field for struct_type? some languages let you do things like that outside of the definition for the data structure but not c++.

are you including b.cpp inside of a.cpp? is this in some function? if b.cpp is the main function and a.cpp is outside of it i don't even know how that could compile.
if i write your code such that both statements in a.cpp and b.cpp are inside of the main function, it works fine.

it'd be much easier to guess your intent if you actually just copypasted all relevant code instead of bits and pieces. i'm not even sure how you've defined struct_type so i just assumed when i tried it myself.

@63233433
why lie on the internet?

lisp will still be around well after python dies when the ml scam ends and scientists move onto the next language that promises them that they won't have to think

tapoueh.org/blog/2014/05/why-is-pgloader-so-much-faster/

C is the only language you'll ever need. Anything else is a memelang

It gives finegrained control of where things are allocated just like C++. You can quite far avoiding heap allocations entirely if you want to.

You can also disable the GC and free memory manually (though in that case it won't be safer than C), or switch to a concurrent GC tuned for real-time applications.

>GC tuned for real-time
oxymoron

>after python dies
will never happen, as we already established it's better than lisp in evey way

>better than 20x speedup moving from python to common lisp
B-but Python is newer! Lisp is ancient!

The real-time GC is concurrent with a provable upper bound for GC pauses.

If you have really hard real-time requirements you just don't use any heap allocations, in that case GC or no GC is meaningless.

Julia:
-Call C functions directly: no wrappers or special APIs
-Good performance, approaching that of statically-compiled languages like C
-Powerful shell-like capabilities for managing other processes
-Lisp-like macros and other metaprogramming facilities
-Designed for parallelism and distributed computation
-High-Performance JIT Compiler

Stay mad, faggot.

Julia:
-Fake benchmarks

Try it now.
Thank me later.

>Good performance
>approaching
in other words: slow

I love C, but my first love is BASIC.

this is why you're all unproductive
if you're going to shill your memelangs might as well give a decent argument or even bother to post a fizzbuzz example or even hello world example

rule 6, bother to make a decent reply

I like Julia. Also: multiple dispatch
I wish the memory allocation had more flexibility.

A fizzbuzz example or a hello world example tells you almost nothing about a language.

Haskell:
main =
putStrLn "Hello, world!"


Python:
def main():
print "Hello, world!"

>says the guy who has never even touched it.

what memeshitters don't understand is the following:
if you need performance, there's C
if you need a mountain of abstraction for "muh productivity", there's Python
there's no place for your shit languages "almost" as fast as C or "almost" as flexible as Python
fuck off

I like that you didn't reply to my suggestion of "FreeBASIC".

Lisp is far more flexible than Python.

why touch a slow, useless language?

The meaning of the first line alone is:
>there exists a function, called loop (fun loop)
>for all l, of type int, such that l lies between l0 and r ({ l: int | l0 the function takes as parameters:
>an integer l, whose contents are called l (l: int l)
>an integer r, whose contents are called r (r: int r)
>and res, a by-reference pointer which may be uninitialised, whose proof is not consumed, but turned into a proof of res(l) upon exit (res: &ptr? >> res(l))
>the function also may write memory as a side-effect (:)
>lastly, it returns nothing (void)

Agreed. Julia is great, but the implicit pointers in mutable structs are annoying. I get that this is necessary because the type of the field is allowed to change, but I wish I was able to do this for fields that are constrained to a specific concrete type.

There's no productivity in Python. It's a lie. I've done enough "professional" Python to learn that.

The sure sign of a new language being shit is obvious shilling. I'd say that's what we're seeing with Julia on /dpt/.