/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

youtube.com/watch?v=NvQH8b1g3Yw
github.com/enfiskutensykkel/bf-compiler
en.wikipedia.org/wiki/Brainfuck#Commands
corsix.github.io/dynasm-doc/tutorial.html
shenlanguage.org
github.com/clojure/core.typed/wiki/User-Guide
factorcode.org/
stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118
twitter.com/SFWRedditGifs

Daily reminder to not abuse greentext and to always ask people who abuse greentext whom they are quoting!

Lisp is the only programming language worth programming.

I like the OP image

youtube.com/watch?v=NvQH8b1g3Yw any of you gonna take this job?

>whom they are quoting!
*who

*whom [sic] they are quoting!

Fixed my brainfuck compiler so it works again for newer versions of macOS.

github.com/enfiskutensykkel/bf-compiler

Why not a bf2c? I can not compile your soft. I am using a free (as in freedom) OS.

Well thats pretty nice readme.md, tips for writing nice doc.
negative points for making it locked to damn OSX

This bait is way too obvious senpai

I'm having second thoughts on Clojure. I did some exercises in it, but there are some problems that really frustrate me. Most notably is the lack of a static type system. Runtime crashes because of type assertion are just stupid nowadays. Another problem I have with Clojure is that lack of proper pattern matching. Haskell really spoiled me with proper pattern matching.
So I think I'll ditch Lisp for ML. Any suggestions? F#, OCaml, Haskell? Does F# even run on the GNU operating system using Linux as its kernel? What's popular?

>Why not a bf2c?
Because that's what literally everyone does for their first bf interpreter implementation.

>I can not compile your soft. I am using a free (as in freedom) OS.
Not my problem.

>Well thats pretty nice readme.md, tips for writing nice doc.
Thanks

>negative points for making it locked to damn OSX
It's not "locked to", it's implemented for it specifically. macOS doesn't understand ELF ootb and this being a toy project I don't feel like both writing it and testing it on Linux too. Too much work.

>>I can not compile your soft. I am using a free (as in freedom) OS.
>Not my problem.
Non portable code is the mark of code monkeys.

i wanna go to machine precision in C.
i implemented an iterative method and i want to evaluate my residual errors.

the error should be smt like 1e-16, but i seem to get only 0.

im using only standard double datatypes.
is there something i can do?

Can someone post the whole pic in OP?

>Non portable code is the mark of code monkeys.
It's a fucking compiler for a specific platform. It's not supposed to be portable.

This isn't Java byte code kiddo.

You're using clang and you failed to understand the main idea of llvm.

user, this isn't an LLVM frontend...

Both F# and OCaml have crippled type systems which might as well be dynamic. Haskell is slightly better.

Ye,s because you're a code monkey. A true coder would have target llvm. But that's not what you are.

>Both F# and OCaml have crippled type systems which might as well be dynamic.
How are they crippled?

OCaml

No HKTs, making them a complete joke even compared to Haskell's type system. Which is saying a lot.

Why would I choose OCaml over Haskell?

Okay.

I thought you were saying other than Haskell

*whom

'Whom' is the object of the clause (i.e. they are quoting whom), thus it takes the objective case.

People aren't required to correct sentences when quoting them.

>Why not a bf2c?
Not him, but I assume you mean a brainfuck to C translator? That's pretty basic shit compared to actually making a running executable like user does (even though it is for non-free pig disgusting homosex os echs). You could basically just copy paste the wikipedia article on brainfuck.

en.wikipedia.org/wiki/Brainfuck#Commands

You'll never be truly satisfied with any type system.

Weird, I would've assumed the bf2c is annoying because C is complicated. It's supposed to be an input language, not an output one. I know ppl sometimes generate C, but it strikes me that there must be a better way such as hooking into the IL or something. It's clearly portable if done correctly tho I must admit.

Why is that?

True, but dynamic type systems are outdated. For example, Python recently got support for some static type assertion.

starting to work on a simple neural network based app that sorts all images on Sup Forums by cuteness and puts them in a queue for me to approve/decline the download. If I can get it to work somewhat reliably I will train it on different tasks as well, like finding the best memes according to my superior taste.

>I would've assumed the bf2c is annoying because C is complicated. It's supposed to be an input language, not an output one.
Actually, C isn't complicated at all. It's extremely simple, has a very small standard library and a very small set of keywords.

It was always intended to be a portable assembly.

>I know ppl sometimes generate C
Not sometimes, virtually all modern compiled languages have a step transpiling them into C code first. Haskel/GHCl has this, Forth has this, Rust has this etc. By supplying the right flags to the compiler, you can make it stop at the C step.

Hell, even some interpreted languages have support for converting it into C (which is trivial if the language supports JIT). There are JavaScript to C translators, Python to C translators etc.

C is not a complicated language, it's really simple. The fact that C programming is hard is not because the language is complicated, but because there's so much stuff that's undefined and implementation specific.

>Not sometimes, virtually all modern compiled languages have a step transpiling them into C code first. Haskel/GHCl has this, Forth has this, Rust has this etc. By supplying the right flags to the compiler, you can make it stop at the C step.
No user. They can produce C, but they don't use as a standard step.

Wrong! Python3 still is and will remain dynamically typed. The type annotations don't interest the interpreter, they aren't assertion. they are to be read and statically reasonned about by a separate tool.

>dynamic type systems
That's impossible.

Even when using PyPy?
OK, languages without a static type system.

Actually, C isn't complicated at all.
I should define complicated, I mean that the syntax is human-oriented, so generating it is just a waste of CPU time and program complexity. Not saying it can't be done.

I'm pretty skeptical about this "everything that exists transpiles to C" claim, again, why don't they target an intermediate language?

What is the connection between a JIT and AOT compilation targeting C?

That's impossible as well.

>They can produce C, but they don't use as a standard step.
You are right (although some do IIRC, I'm pretty sure that GHC does this, but I may be mistaken).

However, creating C code is pretty trivial no matter if you compile to C as an intermediate step or reverse generate it from your instruction set.

>why don't they target an intermediate language?
They usually do, I was mistaken. See and >What is the connection between a JIT and AOT compilation targeting C?
See above. Once you have byte code, recreating C is fairly trivial.

Nth for C#, ASP.NET, Visual Studio, the entire .NET Framework, Bill Gates, Paul Allen and Microsoft™.

>Even when using PyPy?
Maybe there are PyPy modules that only accept programs that are type-correct and provide some benefits in return. PyPy is said to be written in RPython, a language derived from Python that's more restrictive so types can be infered, and this allows PyPy to bootstrap itself. Maybe there are already other variants of Python in the same vein. There's also Cython....

>reverse generate it from your instruction set.
>Once you have byte code, recreating C is fairly trivial.
Oh ok, I see now. Thank you user for enlightening me.

anyone, please

>hooking into the IL
Did you confuse C with C#? If not, how do you know what IL is but don't know the difference between C and C#?

This

Mea culpissima user, LLVM has an IR, IL is a term used within the context of the MS CLR. I should have typechecked before saying such horrendous bullshit. I should've taken more vaccines so as to be as autistic as you, my god-emperor.

Google "c high precision math". It'll be the first result.

What text editor do you use that was made in this decade? Atom looks fancy but the performance sucks nuts

Emacs

>that was made in this decade

ed

Visual Studio

IntelliJ

pen and paper

Excuse me?

If Buddhism was a language, what language would it be?

Visual Studio, Visual Studio Code. Vim keybinds.

Sublime Text 3.

Haskell. That which can't do anything can't cause harm.

Why not a bf jit?
corsix.github.io/dynasm-doc/tutorial.html

It's one of the few languages that can be programmed, though.

Typed Racket.

shenlanguage.org

>Clojure
>type system
doesn't clojure have core.typed for optional type system?

Java Enterprise Edition

please don't say such dirty things while posting cirno

Microsoft Visual Studio has improved my work flow!

It does introduce a type system, but it feels more like a hack.

How?

What sort of type system? Is it at least half-decent?

How do I manipulate text more efficiently

What is the fastest brainfuck interpreter?

See github.com/clojure/core.typed/wiki/User-Guide
It does provide a type system, but it's a complete joke nowadays.

I second this. Whatever IDE you feel comfortable with + Vim keybindings. I use my same vimrc, without the plugins. Oh how I do miss gundo though =(

Why isn't there an language that has both stackful coroutines and pass-by-value semantics?

Currently writing a set partitioning function in Lua. The ability to yield from within a recursive call is super nice, but fuck the whole "tables are reference types" thing. I wish it were more like python =(.

(sorry about the quote)

PSA: There is a "[Post a Reply]" link at the bottom and the top of the page!

Is Idris Haskell-with-dependent-types or is there more to it?

factorcode.org/

Vim novice here, post your useful vim tricks!

has some nice syntax customisation

:q!
emacs -nw

stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118

Not sure exactly what you mean by stackful coroutines, but I bet C++ has it. Practically every language has pass-by-value too.

It's strict.

:E :Te :Ve :Se

>not using spacemacs

Is there any good deep learning framework that works easily on windows, preferably python3?

is there a way to disable :W in vim?

Remove the ':' and 'w' keys from your keyboard.

You configure the key to do nothing.

but then i can't :w

how?

Why should anyone use it instead of ordinary emacs?

I don't know I use only emacs. But I hope that after years of defending vim against emacs, that you can configure such a thing on vim.