/dpt/ - Dependent Profunctor Types

What are you working on, Jow Forums?

Previous thread:

Attached: agdabook.jpg (405x500, 37K)

Other urls found in this thread:

github.com/thepowersgang/mrustc
wiki.sei.cmu.edu/confluence/display/c/SEI CERT C Coding Standard
pypyjs.org/
twitter.com/NSFWRedditImage

Attached: XilsKrW.png (1024x1024, 112K)

But what if it's already in a better language than Rust? Something like OCaml or Haskell

Ironically, rust is being rewritten in C++: github.com/thepowersgang/mrustc

Concurrent separation type theory

learning Idris.
The tutorial on their site could be better, had to research some stuff myself but that's okay. I'm glad that I use Haskell a lot.

If anyone is thinking of learning Idris then you better have Haskll in your little finger

>what if it isn't already written in Rust

The base Rust is partially written in C++ anyway as it uses LLVM.

>no borrow checking
then why the hell would you use Rust lmao

LLVM rewrite in rust, when?

Attached: 1516395905377.jpg (756x715, 83K)

the real akariposter would use C, not C++, not Rust

Never, I don't think the LLVM guys would want to touch Rust.

Wrong, the akariposter has been rewritten in Rust

Attached: 1515748549518.jpg (762x613, 108K)

reminder

Attached: 1533349323300.jpg (1000x800, 179K)

fake news

I basically went into a CS master's program from a non-stem undergrad, therefore I've been learning to do machine learning and other meme applied stuff in Python but without ever learning CS. I don't want to just be a braindead coder, I want to understand computer science, and so I'm going to try to implement my own data structures and stuff to really understand how things are stored in memory and all that fun stuff.

My question is that I've heard Python is useless for understanding these things because it doesn't give you control over things like pointers and memory management. Is this true, and to what extent? I'd rather not learn C or something just for this one purpose because time is an issue for me, but I guess I could if necessary... what do y'all think?

Learn Rust

Don't learn Rust yet

What does IO monad exactly do? Is it just used for ordering operations (read own write etc.)? What if my custom Racket (do ...) macro guarantees that?

>Is this true, and to what extent?
yes
completely

half the point of langs like python is to hide complex stuff like that from brainlets who could care less, or have more interesting things to care about
python is good for prototyping and for throwing things together to fuck around with C libs in interesting ways, but not much else

IO lets you use and manipulate side effects like ordinary values

Why the hell did they call it IO ''monad''

In C is there any reason to do
int func(int arr[])
over
int func(int arr[ARR_MAX])
is there a difference?

If you can't use Rust, I hope you at least use SEI CERT C Coding Standard for your C code
wiki.sei.cmu.edu/confluence/display/c/SEI CERT C Coding Standard .

Agreed, this is a really interesting feature. For instance; the state monad in the standard library is not hard coded into the language. Instead you can define your own monads by writing weakest precondition transformers. As far as I understand the standard library state monad is parametric in a model of the heap/memory and is used both with a ML-like heap model and a more complicated heap and stack model when writing code that compiles to C

What should I learn after C?

forth, lisp, ocaml, assembly

I'm currently going through the reverse polish notation calculator exercises in K&R and man something about stacks gives me a massive erection.

C#

Thanks. How about Java/Scala, is that any better for this purpose? Scala is relevant in industry so I could justify learning it.

You should definitely do int func(int *arr)
array parameters do not exist in C and it's misleading to pretend that they do

I wish they hadn't used that phrasing, it conflates various things.

There's an IO type constructor. You can have values of type (IO a) where a is some type. There is a monad instance for IO which can be used to sequence such values, among other things.

thanks, I've only been using pointers thus far and have seen some people pass arrays so it confused me

Learn Java and C++ and JS and you will have covered 90% of jobs

Thanks. Not Java or Sepples?

depends? what do you wanna learn?
something in the exact opposite direction?
scheme
something multipurpose and fun?
CL
something quirky but with cool niche uses?
Forth
something generally useful and employable?
python
industry standard?
java
deeper to the core of things?
ASM
something painful?
javascript

No. Learn OCaml after C# because it is the only decent FPL and some script kiddie lang after that.

I want that will give me the best chances for a job. And one that i can earn well in

Thanks

>the only decent FPL
Idris would like a word with you

learn C++ if you wanna fuck around with making your own data structures
learning C++ will also let you learn various libraries in either their native lang or close to it
most openGL docs, books. and tutorials assume your working with C++ for example iirc

You mean like 'do c

getChar is a side-effecting computation that can be manipulated as a value of type (IO Char).

L O L
good luck buddy

pypyjs.org/

So apparently, pypy.js beats the CPython interpreter in most benchmarks. Why is CPython such a horribly designed interpreter?

>one that i can earn well in
lel
hate to break it to you user, but alot of the higher paying programming jobs are in areas where even with the high wage the costs of living mean you'll be living in squalor anyway
programmers also get treated like shit by companies because, if this thread isn't any indication, most programmers are autists that work 8 hours straight programming at work then get home and program more for fun
if you're not obsessed with this shit you'll hate your life very quickly
i was considering a career in CompSci till I heard how draining it all was
skip it, learn a trade or something else in demand

Thanks for your support

>working through HtDP 2nd edition
>put off for a couple days
>come back, book no longer online and there's no pdf on gen.lib.rus.ec
ahahaha FUCKING EPIC
god it just had to happen when I finally decided to learn

Attached: 1531592559715.jpg (1898x2274, 250K)

getChar gives you an IO Char. There's no way to get a Char out of that value. However, you can transform it and get back another IO value representing getChar followed by whatever transformation you did. You can also combine it with another getChar to have an IO (Char, Char) or something.

do notation is syntactic sugar. You can never get the c in c
getChar >>= (\c2 ->
return (c1, c2)))

nevermind i just found it

Im very passionate about it. I just want to earn an above comfortable salary which seems to be on offer for Java

If you frequently procrastinate anyway, just buy human resource machine on steam.

It's basically a puzzle game which acts as a soft introduction to a simple assembly language. You will understand pointers when you are done with it, possibly better than someone who made a half-assed attempt to learn C but got confused by the pointer syntax.

> You can never get the c in c

>working through a book
>don't have it downloaded
makes sense since all wojak posters are retarded

Why does /dpt/ constantly shit on exceptions?

c++ and java for job opportunities, the others are for learning different styles

if you go with java, prepare to be competing with pajeets. even if you get the job you have to deal with their shit code.
programming as a job is pain bro, s k i p i t
I say that as someone that was once very enthusiastic about this shit
if you're like a lot of the types that are like you programming is probably one of the few skills you have that you think you can turn into a paying career
trust me, learn another skill, pursue another route- from scratch if you need, it's better than getting stuck in that minefield of a career space
even if you do find a nice place. these tech places get bought out, they get new managers, they cut their budgets. you will lose your cushy spot if you ever happen to get it in the first place

Because monadic error handing is objectively superior.

exceptions are basically an implicit either monad

I need a quick overview of JavaScript that covers the basic syntax and not the autistic details of every built-in function and web development crap since I'm not doing web dev. Any suggestions?

It's over, Rusties.

Attached: theLogo.png (400x400, 15K)

What are the drawbacks of Rust other than SJW community?
I'm interested in learning it

just guess
the syntax is so simple a webdev can use it

No HKTs

implicit and dynamically typed, yeah. That's why they suck.

>What are the drawbacks of Rust

The fact that nobody will ever run your code.

they're superior because they don't infest function type signatures

Everybody that runs a recent version of Firefox runs Rust code.

If they're not part of your function signatures, why even have function signatures?

>Everybody that runs a recent version of Firefox
Like I said, the fact that nobody will ever run your code.

>they're inferior because they don't show up in function type signatures and are therefore hidden
ftfy

Attached: 1508102981867.png (270x320, 103K)

very ugly way of handling errors and they add complexity

That's what I normally do with C-based languages, but a lot of the JS syntax seems kind of retarded and the language is some kind of weird pseudo-prototype-based language but also kind of object oriented but not really.

they're *implicit*. you know they're there, you just don't need to type them out. cleaner code

How would i know they're there if they're not part of the function signature?

explicit is better than implicit. If it's a chore to type out, that means your language syntax is to blame rather than its semantics

they're always there, that's the beauty of it

You're bargaining.

nah, you're being disingenuous lad

>int foo();
>Lol jk, it's actually int|FuckYOuException foo();

>beauty

Attached: 1505722443952.jpg (512x512, 84K)

c is a crutch for people who can't write efficient code otherwise

I've been thinking of a shell scripting language where every singe operation in there is merged into one big atomic operation. You run the script, and either ALL OF IT WORKS, or none of it. No "it crashed halfway through and scattered a bunch of broken shit all over your harddrive"-bullshit.
Yay/Nay?

come back when embedded system with 2mb of ram can run nodejs electron nigger bullshit

QUICK!
Which general purpose library do you use for your C programs?
qlibc, tbox, glib, zpl, apr, nspr...?

Just use types

What if the script makes network requests?

It seems an interesting idea to be honest, but how would you implement it?
The first thing that comes to mind is that it should initially somehow emulate the environment in which it should execute, and only if everything succeeds in this sandbox is the script actually executed.
And again, it would be predictable only if all the work is done locally, since predicting network responses is impossible.
Another approach could be to keep track of every step. and in case something bad happens, revert all changes. It would handle network scripts, but it would be also quite expensive and error-prone in practice to implement.

Just use C++.

Zero-overhead software transactional memory

Haskell?

>but it would be also quite expensive and error-prone in practice to implement.

>

I'm interested in this, but cannot imagine how it could possibly be zero-overhead (assuming memory allocations and atomic compare-and-swap are considered overheads)

just have no side effects

>assuming memory allocations and atomic compare-and-swap are considered overheads
They are costs, not overheads - the overhead is the cost of the abstraction compared to the cost of the optimized implementation

Assuming you are the user who is working on it, what is your current implementation?

300K is the best programming temperature

Post rock is the best programming music

>just have no side effects
That's isomorphic to doing nothing at all. I don't need a fancy programming language to do that!

Hey this is pretty neat, gonna pick it up. Thanks friend.

pls respond

>what is returning a result