/dpt/ - Daily Programming Thread

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

Other urls found in this thread:

pastebin.com/X4jzhmfK
stackoverflow.com/questions/3077866/large-scale-design-in-haskell
twitter.com/AnonBabble

>Posted before the bump limit
Delete this thread, idiot.

Lisp is the most powerful programming language.

first for cs is useful

I'm learning GNU Octave by writing some functions related to quantum computing.
I have to fix the quantum relative entropy function, because it's negative and it should always be non-negative.

I would post my code here but I don't want to be turned into a CS grad meme

You are already a CS grad meme.

First for (insert language here)

It doesn't matter what the language is you fucks will still argue over it

fn (type arg) = (type return) { body }

i've been turned into a cs grad meme but i posted the code intentionally trying to bait it

>being mad you don't know enough about programming languages to be able to take part in the arguments

god I love haskell
is there anything that can beat this beauty of its expressiveness

They're each good/bad in their own way, user.

>haskell
Trash.

name three (3) useful large-scale programs written in haskell

xmonad, pandoc, GHC

xmonad

name three (3) useful large-scale programs written by you

>beat this beauty of its expressiveness
How can you beat something which simply doesn't exist?

Irrelevant.

So are you

Vicious

Yes, this is a common thing pleb-filter language users feel. We can only hope this is temporary and you don't get blinded by fake things.

what language is better for hacking, python or C?

C is good for nothing

Ada

how do you expect to hack when your language doesn't even trust you with memory?

JavaScript is all you need, go learn that and don't worry about anything else

Honestly, once I started doing projects, I was frustruated because of the lack of libraries and shitty documentation and package manager systems

joke aside, you can hack using only a notepad.
Most hacks are not very sophisticated, so python to automate the boring stuff (incidentally the title of a book) is perfectly fine.

fuck you.

English, for social hacks

That doesn't have anything to do with the supposed "expressiveness" a language with a crippled type system supposedly "has".

>crippled type system
expand
also, haskell is super fucking expressive
on average, it has a third the loc of other langs like python, c or sepples

Python for IDA, Ruby for Metasploit

Being better than most languages doesn't somehow make it "expressive". A type system where you can't encode list length in the type can't be called "expressive" by any stretch of the imagination.

who idris

thats because of infinite lists, dipshit.
its intentional.

Not to mention that the number of elements has jack shit to do with expresiveness.

Is Typescript comfy? I think it's comfy.

>Made an integral portion of an program in Ada
>I was moved to a more pressing project
>mfw my old partner has to now take a crash course in Ada's tasking model

asm and c++17 are the only comfy languages

C++17 is not a uncorn that suddenly makes C++ "good". Fuck off with your shitty FUD

C++ has been good since C++11, it has been great since C++14 and is not really, really, awesome with C++17.

Proof:

pastebin.com/X4jzhmfK

A pleb-filter language user who doesn't even have the slightest idea of what he's talking about. That's pretty common.
You can have languages which allow both infinite lists and types like "a list with n elements".
>Not to mention that the number of elements has jack shit to do with expresiveness.
A language which doesn't let you express your intentions in the types can't be called "expressive". It's as simple as that.

>Proof
I didn't know you were joking

This is where I tell you to go kill yourself.

Who are you guys quoting?

> using t = concat< typename meta_functor< head >::t, typename transform_impl< typelist< tail... >, meta_functor >::t >;

>muh dependent types
ayy lmao, where is this even useful?

>muh
>incorrect usage of ayy lmao
>"""""useful"""""
Did you have a stroke or something?

Metaprogramming was a mistake.

your intentions are retarded in this case.
Ever thought about that possibility, dipshit?

Also for large scale projects in haskell:

stackoverflow.com/questions/3077866/large-scale-design-in-haskell

I really wish the next C standard includes support for lambda/closures and gives us a real macro system.

Maybe even standardize a common set of data structures as part of the standard library.

here, meme master

>muh dependent type
wew lad, where is this even useful?

Just use Lisp.

already exists, its called C++

Lisp has no libs.

That post didn't make a single claim about "usefulness". All it's stating is that a language which can't have them simply can't be called expressive as per definition of "expressive".

>your intentions are retarded in this case.
Me not being able to express them already means that the "language" isn't expressive.
>Also for large scale projects in haskell:
Where did I even ask you for this? I couldn't care less.

In vim, how do you
1. Increase/decrease indent of a specific block?
2. Add/remove comment sequences like // or """ in a block?

C++ can't even compile all C code.

ghc doesn't count

>2017
>STILL using C trash

>muh
>wew lad
>meme
Were you dropped on your head and fed bleach as an infant?

it only compiles the good parts.
Built-in QA, wanker.

Wrong.

Can you address my talking point, you faggot?

>watch me move those goalposts

Can I pretend I know C++ on my resume?
I wanna write C with classes, not that C++11 stuff.

Learn templates.

No one knows C++, not even Björn Stosstrupp

Your talking point isn't worth addressing as I didn't and will never make claims about anything's "usefulness"

don't do this

>only compiles the good parts
>can't compile C11 threads
>can't do generics in defines
>doesn't support safer functions and removes older ones that are bug ridden provided in C11

just to name a few

>claim you need dependent types
>doesn't tell you why
being expressive for the sake of expressiveness is wrong
it should only be for producitivy

>C++
>C with classes
>C++11

>try to optimize my sum of primes program by setting j to i*i instead of i*2 for sieve
>it segfaults so i have to change it back

The original claim was "Haskell is expressive", obviously it can't be since it doesn't have dependent types, a thing without which a type system simply can't be expressive.
I didn't make a single claim, I only showed the inherent retardation in claiming that Haskell is somehow expressive.
>it should only be for producitivy
Anyone over 18 should be able to understand that a language can't have the property of being "productive".

iterate i to sqrt(n) so i*i won't go out of bounds

I want to learn Javascript. are there any recommended books?

Who are you idiots quoting though?

Garbage collectors are for garbage producers. RAII is where it's at.

i dictate my posts and then cortana quotes me and posts them

today i found out about the function
madvise

>madvise - give advice about use of memory
>int madvise(void *addr, size_t length, int advice);

Nice
// raii.rs
fn create_box() {
// Allocate an integer on the heap
let _box1 = Box::new(3i32);

// `_box1` is destroyed here, and memory gets freed
}

fn main() {
// Allocate an integer on the heap
let _box2 = Box::new(5i32);

// A nested scope:
{
// Allocate an integer on the heap
let _box3 = Box::new(4i32);

// `_box3` is destroyed here, and memory gets freed
}

// Creating lots of boxes just for fun
// There's no need to manually free memory!
for _ in 0u32..1_000 {
create_box();
}

// `_box2` is destroyed here, and memory gets freed
}

Are you retarded, meme arrows can be used in other contexts other than quoting.

Is it bad if ive used 5 'for loops' within 40 lines of code

Too vage, post code.

neat

@59849658
>meme arrows

I can't, it is HW for Uni

Please, I'll do your homework.

I just picked these up at my university's library. Will this make me a good programmer?

>C++
No.

>if you have to ask...
you'll give up after the first month

are you a computer science major?

The homework is already complete

>if you have to ask...
He didn't say that though.

alright, now digits cycle to the next one odometer style

anyone else here crack rsa by hand for fun?

(You)
I'm only a sophomore, did shit in a programming competition and want to get better. Also went to a presentation intro to Djikstra's alg and was intrigued. And I'm learning in C++ at my school right now, figured I'd just stick to the same language
Yes. And I want to apply some of what I learned in discrete

i did that in Discrete Structures course