[ / / / / / / / / / / / / / ] [ dir / agatha / cafechan / flags / hkon9 / leftpol / momo / tacos / vg ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

READ THIS - THIS IS THE FUTURE YOU CHOSE


File (hide): c9b63ec40bcabfd⋯.png (21.9 KB, 1024x1024, 1:1, PeMSYqY.png) (h) (u)

[–]

 No.935614>>935620 >>935775 [Watch Thread][Show All Posts]

Beautiful


module mergesort;

import std.traits : isOrderingComparable,
isCopyable, isMutable, isArray;

import std.algorithm.sorting : isSorted;

private void merge(T)(ref T[] arr, ref T[] aux,
in ulong lo, in ulong mid, in ulong hi)
if (isOrderingComparable!T
&& isCopyable!T && isMutable!T)
in
{
debug
{
assert(arr[lo .. mid].isSorted);
assert(arr[mid .. $].isSorted);
}
}
out
{
debug
{
assert(arr.isSorted);
}
}
do
{
// WARN: UNTESTED
debug
{
assert(arr.length == 0);
}
foreach (ulong i; 0 .. arr.length)
aux ~= arr[i];

ulong left = lo, right = mid;
foreach (ulong i; lo .. hi + 1)
{
if (aux[mid] < aux[mid + 1])
{
arr = aux;
break;
}
if (aux[left] < aux[right])
{
arr[i] = aux[left++];
}
else if (aux[right] <= aux[left])
{
arr[i] = aux[right++];
}
else if (i > mid)
{
arr[i] = arr[right++];
}
else
{
arr[i] = arr[left++];
}
}
}

 No.935620

>>935614 (OP)

But c++ lets me plug a custom allocator into any standard data structure. Can D do that?


 No.935661>>935673 >>935781

I tried D in the past but got demotivated so never learned it fully. From the little that I used it it's a better language than C++: the well designed library, the built in strings, arrays and maps, all make it a very elegant and practical language... which unlike C++ is actually high level. Then again for C++ weenies anything above machine code is "high level", even assembler.

Anyway back to D, unfortunately they refuse to standardize it by way of ISO/IEC, because who needs standardization amirite? "Other languages do just fine without standardization." Yeah because they're backed by big corporations, big money, maybe even a government.

Ultimately, the philosophical problem of D is that in order to fully appreciate it you need to be an above-average C++ programmer in the first place. But if you already are, why the fuck would you leave standard C++ for what is basically an unproven language? Methinks toying around with D as if it was a hobby project (which it is) should end immediately, and the language standard should freeze its features in, let's say, ISO/IEC D20, in time to poop on C++20's party. But that's not going to happen because suddenly winning over C++ programmer's isn't the goal anymore... the goal now is having fun or whatever.


 No.935663>>935664

Why post this in /tech/ instead of /prog/?


 No.935664>>935667 >>935668 >>935673

>>935663

Maybe he wanted someone to read it. But it's just the new meme to push D after he got bored pushing Rust. They're both toy languages. People gave up hope for D before many anons were born so it's an unusual choice.


 No.935667>>935674

>>935664

Rust is already synonymous with "meme shit", but D is more unheard of and more similar to C++ so it's easier to push without getting instantly filtered.


 No.935668>>935686 >>935791

>>935664

> People gave up hope for D

What were the reasons? I am curious because I haven't followed D history closely.


 No.935669

I feel like even just reading it requires too big investment. Even perl scripts aren't that hard to read once you get basic grasp of arrays, hashes, (<>) magic and $_.


 No.935673>>935676 >>935683

>>935661

>>935664

What is a `toy language`?


 No.935674>>935676 >>935683 >>935725

>>935667

And what is a `meme shit`?


 No.935676>>935677

>>935673

>>935674

Take another course in English, pajeet.


 No.935677

>>935676

>another course in English

on what?


 No.935683

>>935673

>>935674

What are ``faggot quotes''?


 No.935686>>935855

>>935668

It was pushed as an upcoming systems language and they tried to meme it on slashdot around 2000 to C programmers as the future of C then it became clear it was GCed and the GC wasn't really optional. That instantly killed it for systems work, and it wasn't competitive with the large investment people had in perl or Java, so it had no audience, regardless of other technical issues. They should have called it Y.


 No.935725>>935728 >>935799

>>935674

Anything but C++ or Java

If your lang doesn't guarantee a job, it's an internet joke.


 No.935728>>935729

>>935725

If your lang doesn't guarantee memory safety, feraless concurrency and zero-cost abstractions, it's an internet joke.


 No.935729>>935730

>>935728

If you need safety nets, you're a joke.


 No.935730>>935731

>>935729

You're right. Let's remove the safety nets from guns.

Also, btw: https://www.cvedetails.com/vulnerability-list/


 No.935731>>935734 >>935792

>>935730

One takes a live, the other exposes the codemonkey as a retard. They're not even remotely on the same level.


 No.935734>>935735

>>935731

You're right. I'm so stupid. Please continue with your LARPing. C is the best and most perfectest language btw.


 No.935735>>935736

>>935734

>muh LARPers

lol


 No.935736>>935737

>>935735

>no argument

lol


 No.935737>>935738

>>935736

My argument is still standing unchallenged

You just threw some retarded ad-hominems at it.


 No.935738>>935739

>>935737

Ok kid. You go on and LARP some more.


 No.935739

>>935738

I can see the japanese flag on your asshole glowing from over here.


 No.935741

Another quality discussion spawned by language of equal quality.


 No.935775>>935850

>>935614 (OP)

I RIIR:

fn mergesort(slice: &mut [impl Ord]) {
if slice.len() < 2 {
return;
}

let mut mid = slice.len() / 2;
mergesort(&mut slice[..mid]);
mergesort(&mut slice[mid..]);

let mut a = 0;
let mut b = mid;

while a < mid && b < slice.len() {
if slice[a] <= slice[b] {
a += 1;
} else {
for i in (a..b).rev() {
slice.swap(i, i + 1);
}

a += 1;
b += 1;
mid += 1;
}
}
}


 No.935781

>>935661

>Anyway back to D, unfortunately they refuse to standardize it by way of ISO/IEC

They should in the near future, but currently it is not ripe enough for them to pick.

Same goes for Nim, Python, Haskell and other languages that has potential.


 No.935791

>>935668

DMD (the original compiler) was proprietary, it only recently became free software hence why it's been catching on now.


 No.935792>>935808 >>935851

>>935731

>Your programs should blow up if you make a mistake

>I'm the most perfectest programmer ever and never make bugs

>Just write everything in Assembly lmao, don't you know C calling conventions are bloat?

You write shit code I guarantee it.


 No.935799

>>935725

No programming language can guarantee you a job if you aren't good enough. Sorry to break it to you.


 No.935808

>>935792

>muh code quality

t. code artisan


 No.935850

>>935775

Breathtakingly beautiful. Good work, Klabnikposter.


 No.935851

>>935792

It's not that I never make bugs.

Thorough testing is a lost art.

Now every faggot just waits for the bug reports from the users.


 No.935855

>>935686

>slashdot

Why did you have to bring up those memories anon?




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
34 replies | 0 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / agatha / cafechan / flags / hkon9 / leftpol / momo / tacos / vg ][ watchlist ]