/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

hue.merkoba.com/
youtube.com/watch?v=X36ye-1x_HQ
ebay.com/itm/Computer-Programming-in-BASIC-1986-Houghton-Mifflin-/131997556267?hash=item1ebbaade2b:g:4s4AAOSwcUBYIite
en.wikibooks.org/wiki/Haskell
twitter.com/AnonBabble

First for C

Second for Haskell

A language with dependent types and an algebraic effect system that, in particular, generalizes upon linear types (with effects like Write or Consume) by allowing effects to change the context, i.e. the captured variables of the continuations.

rust doesnt have a stable abi, green threads, or even a built in hash table. do not waste your time with this joke of a language.

So, Idris?

It's a systems language.

session types > dependent effects

Hello Joe

Do session types let you do things like error handling?

ATS
hello Mike

ATS?

yes more or less. you can model exceptions

>dataviewt@ype
ATS is cool but wholly unusable.

I might have to look into them, then.

Working on this atm hue.merkoba.com/

So, what language riddled you us with?

The one I'm "working" on.

I'm not telling you my nickname

nv, is that you?

No. He even replied to me, mate.

That's not to say you're not him too.

Java is GARBAGE. If you are a Java programmer, than just kill yourself already.

What the FUCK is a F#?

a bad language

How much would you say the average codemonkey with one or two years of experience makes in the USA?

how hard is it for such a person to get a job?

trying to find a good book on BASIC via ebay at the moment

Goodbye modern world

ATS is garbage

what books are you looking at ?

Is project management a meme?

I'm working on my first large solo-project and I keep getting lost.

I thought I could just keep a simple todo list and go top to bottom. But whenever I get to work on the first item, I discover other features that are higher priority and have to switch task and rearrange my list. It has been eating up my programming time for 2 weeks now.

How do you guys keep track of development progress?

Who is she?

am I doing ok senpaitachi

(define remainder (lambda (n1 n2) (round (* (- (/ n1 n2) (floor (/ n1 n2))) n2))))

(define (rule n)
(cond ((and (= (remainder n 5) 0) (= (remainder n 3) 0)) "fizzbuzz")
((= (remainder n 3) 0) "fizz")
((= (remainder n 5) 0) "buzz")
(else n)))

(define (fizzbuzz n)
(define (helper n) (list (rule n)))
(if (= n 1)
(helper n)
(append (fizzbuzz (- n 1)) (helper n))))

(fizzbuzz 100)

with my fucking brain

google "tomboychan"

Can somebody tell me what I can do with dependent types besides proofing that my program is correct?

Why? Fortran is at least still being improved on?

youtube.com/watch?v=X36ye-1x_HQ

(define fizz (λ (x) (= 0 (modulo x 3))))
(define buzz (λ (x) (= 0 (modulo x 5))))

(define fizzbuzz (λ (x) (and (fizz x) (buzz x))))

(define (fizzer x)
(cond
((fizzbuzz x) 'Fizzbuzz)
((fizz x) 'Fizz)
((buzz x) 'Buzz)
(else x)))

(define (do-fizzbuzz n) (map fizzer (range 1 n)))

Nothing, really. That's all types do. But in the process of designing your specification and proving it, you get documentation and more aggressive compiler optimization.

Version that is computed at read-time (Common Lisp):
#.(loop for i from 1 to 100 do
(if (not (or (zerop (mod i 3)) (zerop (mod i 5))))
(princ i)
(progn (when (zerop (mod i 3)) (princ "Fizz"))
(when (zerop (mod i 5)) (princ "Buzz"))))
(terpri))

oh, cool. thanks

Each time I come back I'm reminded you guy's dedication knows no bounds.

>Why? Fortran is at least still being improved on?

Just got a job maintaining BASIC legacy code

Should I learn Common Lisp after finishing SICP?

You get some other nice type information that most languages have trouble with. e.g. the length of an array in its type signature. Or you could have a function that takes code as input and compiles it, along with the type of the resulting program

Sure, any Lisp is worth learning.

It doesn't seem to follow the spec.

Basic is the best

looking at buying this right now

ebay.com/itm/Computer-Programming-in-BASIC-1986-Houghton-Mifflin-/131997556267?hash=item1ebbaade2b:g:4s4AAOSwcUBYIite

Wrong.

Y'all need to work on your Racket-fu... this isn't your ordinary Scheme
#lang racket
(require (for-syntax racket/match))
(define-syntax (fizzbuzz stx)
(with-syntax
([(x ...)
(for/list ([i (in-range 1 101)])
(match* ((remainder i 3)
(remainder i 5))
[(0 0) "fizzbuzz"]
[(0 _) "fizz"]
[(_ 0) "buzz"]
[(_ _) i]))])
#'(begin
(displayln x) ...)))
(fizzbuzz)

There is some sticky stuff which seems to accumulate in my belly button. How often should I clean it out? It's distracting me from programming.

Formally prove it then.

Okay, thank you.

Haven't you heard of the Howard-Curry correspondence you slime? I guess CS education really has gone down the tubes.

f num=1:1:100 w $s(num\15:"fizzbuzz",num\3:"fizz",num\5:"buzz",1:num),!

Alright, whats a fun project that wouldn't take much time (week max) on Python or Java that I could just throw into my sub-standard resume for an internship.

Twitter bot? command line app? media player?

>Reddit shoutout

def spiral(n):
if n == 1: return [[1]]
if n == 2: return [[1,2],[4,3]]
if n == 3: return [[1,2,3],[8,9,4],[7,6,5]]

out_spiral = [[i+1 for i in range(n)]]
magic_number = (n-1)*4
for row in range(n-2):
out_spiral.append([magic_number - row] + [spiral(n-2)[row][i]+magic_number for i in range(n-2)] + [n+1+row])
out_spiral.append([i for i in range(n*3-2,n*2-2,-1)])
return out_spiral


Just one stupid solution :^)

Having heard of it isn't enough as you have just demonstrated in this very post. By your retarded logic any program follows any spec.
I guess basic reasoning skills are too much to expect from someone who can't follow a simple spec.

have you coded in the superior paradigm yet?

Nice dubs, but why should I care what color the threads are?

What dialect? Like actual line-numbered BASIC, or do you mean something like VB?

Haskell is an monarchic and anglican programming language, not a disgusting communist language

Functions are isomorphic to logical proofs. Was that too hard to understand, brainlet? Your spec is wrong.

>What dialect? Like actual line-numbered BASIC, or do you mean something like VB?

actual GOTO line numbered BASIC, the program was written in 1987-1988 and can be run on a a 486 computer with 4mb of ram

There is no networking and the different locations that use the software physically mail in a CD once a week with their sales info on it to the main office, it will be my job to maintain the software

Why would I be """coding""" in the c*mmunist """functional""" paradigm? Thankfully Haskell isn't associated with your image as suggested in

Something like that can't possibly be that difficult to rewrite, can it? How large is the codebase?
That's sounds fucking horrendous .

Functional programming books for non-programming newbies? I've been programming in C and C++ for years, but I don't know a goddamn thing about FP.

>Something like that can't possibly be that difficult to rewrite, can it? How large is the codebase?

not exactly sure yet I have not had a chance to inspect it well, I am thinking of rewriting it in python and using a real database/server setup

it is horrendous but they have been using it since 1988 and it works for them, it's a loan company and they have 18 locations. They are just used to it and getting the data off the CDs and manually reconciling the sales totals keeps 2 secretaries employed

That's not really a retort to my point. The spec itself is a program.

en.wikibooks.org/wiki/Haskell

Learn you a Husklel if you're a retard.
The Haskell wikibook if you're at least average.

And that program is wrong. Try again, I'll wait.

...

That's literally not even a valid reply to what I posted.

Of course it is. You are incorrect, and fail to accept it. This is commonly known as "denial."

Yeah, I like drugs a lot too, but apparently not as much as you do.

Please rectify your behavior or take it to /drg/

Not an argument.

Conundrum.
This needs to be a union, i.e. the size needs to be constant regardless of the value of "tag".
OptionData : Set -> Bool -> Set
OptionData _ false = Unit
OptionData A true = A

This shouldn't be, obviously. The size needs to depend on the length.
Vec : Set -> Nat -> Set
Vec _ zero = Unit
Vec A (succ n) = A * Array A n

Just by these examples, it seems like non-recursive types should be unions and recursive types shouldn't be, but this isn't what I want.
Ideas? I mean, I can make the user add their own padding and then have a separate proof that the size doesn't depend on whatever parameter, but that's a lot of work.

the latter

Shoulda taken the blue pill.

What?

See

the user provides a constant space proof
even better, allow the user to write the encoding

With just size, it's okay. With alignment it would be a nightmare, I think. I'll experiment, but I don't like the idea much.

I guess with decent metaprogramming (i.e. the ability to inspect the structure of types) it could be done by a library as opposed to being baked into the language.

What are hardest things to program? Drivers, OS?

Also how hard would it be to make a driver for say a graphics card, and how hard would it be to make an OS?

Even if I were to say no, would you believe me?

I am not interested in this question.

This is actually the exact point of the lang I'm trying to make
It has """dependent types""" as in values at the type level, but only statically.
e.g.
array_of : fn {n,t} t -> array(n,t);
...
array_of{4}(0) => [| 0, 0, 0, 0 ]

static { N = 4; }
array_of{N+1}(1) => [| 1, 1, 1, 1, 1 ]

let { n = int.parse(io.read()) };
array_of{n}(3) # not valid; n must be statically available

Do you see a question mark at the end of my sentence?

I find your lack of interest disturbing.

>question mark
They're actually called ``query curls", user.

Yes, there is a question mark located at the end of the word "sentence."
There is nothing about which to be interested.

As for metaprogramming, I'm working out the syntax such that it is generic enough to be manipulated by macros.
The entire BNF is something like
E ::= | | E ( E, ... ) | E [ E ] | E { E; ... }
Infix operators are syntax sugar that gets transformed into a prefix notation
f(x) + g(x)
becomes
+ [f(x)] [g(x)]
gets expanded by a macro into
ops.plus(f(x), g(x))

same goes for other infix operators, e.g. ":", "->", "="

Types are first class values, so you can manually specify functionality for type operations, namely:
size of the type
list of fields and their types
offsets of fields
btw. field access is object[field]

It's basically gonna be the metaprogramming and low level unsafety of C++ on crack, and hopefully without trash syntax

I think you mean "interrogation noodles."

Just make it homoiconic.

C is cancer

Coercing the ruby bastards into making it better for gentoo+mingw

It is completely homoiconic, it's just that parens are really ugly syntax for representing types (fight me).
Note that e.g. "E (E, ...)" *usually* means applying a function, but not necessarily, since it's just general syntax data that can be manipulated by a macro.
I'm still working this out though and I'm not 100% sure about this syntax but it seems reasonable enough