/dpt/ - Daily Programming Thread

Lisp is the most powerful programming language.
What are you working on, Jow Forums?

Last thread:

Attached: lain-lisp.jpg (640x480, 43K)

Other urls found in this thread:

learnyouahaskell.com/
haskellbook.com/
channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Functional-Programming-Fundamentals
twitter.com/SFWRedditImages

nth for Nim!

2nd for OCaml

how do I learn haskell from 0

programming is a subset of Anime

Attached: 1533714494940.png (1024x768, 381K)

Made a small improvement in my flashcard game written in Haskell. If all goes well, I'll rewrite some code using lenses.

You guys are insufferable and inane. Especially the functional fags here. It's like talking to 5 year old autistics who flip shit over any opinion that isn't their own.

pls answer

t. brainlet

And yet you're still here.

Thanks for proving my point you low functioning autist.

I'm working on wlroots bindings for chicken scheme. So far I can spam a message to the console every frame, and that's about it. I have written ~1K lines of code.

Attached: kanami-pajamas.jpg (600x900, 63K)

Rust is very bad for beginners

if r=1 or r=2 or r=3:
if r=1:
print("1st for Python")
elif r=2:
print("2nd for Python!)
else:
print("3rd for Pyhton!")
else:
print(r, "th for Python!")

(You)

Attached: 1541703615184.png (500x644, 424K)

dumb pythonposter

>Jira

Attached: dwagNqwq_400x400.jpg (400x400, 23K)

learnyouahaskell.com/

There are some people who had rust as their first language, and seem to like it.
Now, I don't think it's the best route. The friction between programmer and rust are very very high, and they might not make any sense if you're a complete beginner.

kek

Attached: animu.png (149x148, 58K)

except for the tabs being deleted is there Anything wrong with it? r is declared elsewhere and includes the o.p. i guess it should be r012 in that case though

Go with Python. There're more resources (e.g. books, tutorials) for it.

I want to make an autoclicker. Where should I start?

Rust is probably not a great choice for a beginner. A beginner might find it hard to differentiate between the compiler complaining because something is incorrect and because something is correct but too subtle for the compiler to understand.

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

I think smalltalk is more powerful than lisp, but lisp is more practical.
It sucks how the entire lisp ecosystem revolves around sbcl, though. It's only marginally faster than ccl (and only in some cases), but ccl has a precise GC, i.e. the only acceptable kind of GC. Because everyone relies on sbcl so much, though. even roswell can't be used with an arbitrary lisp despite its whole point being to manage lisps.
Also, quicklisp is pretty broken. Tons of packages are available WITH THEIR DEPENDENCIES MISSING in quicklisp, which is retarded. Versions are not updated at the right rate, and you must update quicklisp to update the list of available packages.
Also, lisp as a language is pretty ugly. If it wasn't for its excellent implementations that cover many usecases (none in the strictly embedded or hard realtime world yet, but that's such a niche that whatever), it would be simply wasted potential.
It also sucks that the prevailing attitude is that everyone should just reinvent the wheel with every new program in the lisp world. As a result, there are many libraries for a few tasks, no library for many tasks, and none of the libraries that exist for a task are particularly good.
It's still the best option available though.

t. brainlet that thinks you should be allowed to have multiple references at a time to a variable or array.

What did he mean by this?

I liked this book:
haskellbook.com/
You really need to do the exercises to understand it though.

IT
IS
NOT

>wlroots
I'd love to use ocaml, but unfortunately its ecosystem is too broken for real work. Either you write ocaml for a megacorps with its own custom ecosystem or you just use some other language. Sad.

ccl is shit. Clasp and SBCL are much better
>, lisp as a language is pretty ugly.
Subjective. Lisp is consistent, much better than {}[], etc symbol hell

Or you're a backend dev and OCaml is perfect for backend.

>Rust is very bad
It sure is, user. It sure is.

What about Jane Street Core? It's FOSS.

this
yet, I'm still here because there's no other place to talk anonymously

imagine having to actually write code

>there's no other place to talk anonymously
This is really a sad thing to say in 2019. The internet really went the wrong direction.

>implying consistency implies beauty

Attached: 1547875971957.jpg (1052x1342, 402K)

>inconsistency is beautiful

Third day writing documentation, starting to get very very bored and seriously considering just writing "read the fucking source and work it out for yourself." Now I know why only proprietary software is documented properly.

I didn't say that either, retard. Makes sense that a dynamic typed shitlang user doesn't understand logic.

You wouldn't need lots of documentation if your code was self-documenting.

What language do you use in your current projects and what would you use in your next project?

>being this much of a snowflakel

Beautiful is not necessarily consistent. There's beauty in chaos.

Of course you don't usually need to find bugs in chaos, you just admire it.

Source with up to date comments is the best way to go really.
>proprietary software is documented properly
Oh you naive child.

This tbqh. The only time I comment code is when I know I'm doing something sub optimal that I need to explain.

Right now I have a job writing and maintaining C#/ASP.NET intranet bullshit. Should I try taking up a language that will pay better, or should I just try to come up with a passion project for home?

also take a look at these
channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Functional-Programming-Fundamentals

Java
Ada

I'm And can't find a language that makes me happy. Is it just me? Am I just not able to program

This. Name your functions as what they do and you won't need to document them.

>much better than {}[], etc symbol hell
Definitely
When I say it's ugly, it's in relation to scheme for the most part, but I'd also say ML-style languages are nicer-looking in general (it's about the choice of function names, multiple namespaces and the syntax burden related to it, and similar warts).
>ccl is shit.
Can you explain why? I haven't had any issues with it. As I mentioned, I find a precise GC to be extremely important. For about 2 years I went from language to language to try to implement a tensor-based gpu-backed symbolic computation framework with symbolic differentiation support. It was a good-quality benchmark to evaluate the ability of various languages to deal with realistic (for my tasks) memory usage patterns. Consistently, conservative GC users (like sbcl) would leak memory with no possible recourse (even finalizers aren't getting called at the right time). Precise GCs don't have that problem though.
Beside that, sbcl is well known to be quite buggy on both OSX and windows, whereas CCL tends to work well on those platforms. This matters for deployment.
Compile times for CCL are significantly less than for SBCL. Performance, though, seems very similar (sometimes CCL is faster, sometimes SBCL is faster - if you ignore big numbers, performance is basically equivalent).
What does SBCL bring that CCL doesn't do?
Same question but for clasp, which seems experimental. I think an llvm target is not a very good thing either because llvm (both the API and the ir) change every minor version (worse yet, the API becomes randomly incompatible with the ir fairly often). As a result, too much manpower has to be allocated to keep up with llvm rather than developing the implementation, OR a fixed llvm version must be targeted, which is a big burden on users. Beside that, it seems very unproven and I don't know of any known performance characteristics for it. Finally, it doesn't seem to bring any advantage whatsoever.

this is wrong

What are some websites with interesting programming tasks? I remember there were threads a while ago about one that looked interesting but I don't remember the name.

The comments are actually not bad, but the program is potentially aimed at normies, so if there isn't a PDF with every feature documented it might as well not exist.

Meant to quote

/dpt/

>Name your functions as what they do and you won't need to document them.

process_data_and_print_before_storing_in_database(...) {
...
}

You're doing god's work user. Think of all the people your sacrifice will help in the future.

There are 3 different stdlibs to choose from: jane street (the one I usually go for), batteries, and whatever the newfangled one is called. Batteries is limited, jane street is more complete. The last one is trash, buggy and incomplete last I checked.
But that's not the only problem. Take build tools. There's dune, there's ocamlbuild, there's oasis, there's omake...
What about the macro system? camlp4, camlp5, extension points...
What about parallelism? There are 2 options again.
Even the goddamn repl. There's utop, but there are also 50 variants of utop. And the default repl sucks ass. Also the default stdlib is only usable to bootstrap the system, it's full of critical bugs that are there because there's just no point developing the bootstrap system more than that and it works for bootstrap.

>Is it just me
no, look at all those code artisans who develop desktop programs in electron

Absolutely not just you. I tried everything I could think of, including dead/almost dead/super niche languages. They all suck one way or the other. Lisp is the closest to not sucking but it's still shit. I want a lisp-smalltalk hybrid that can version control and share deltas for the live image, doesn't need to die to save the image, and doesn't need a GC when a GC must be disabled to make the program do its duty. Never ever though.

Sounds like OCaml is low key a mess which is consistent with industry languages that didn't have a good FOSS following so most of the good shit is proprietary.

best way to understand whats happening in 1k line functions and 10k line classes?

Thanks user, I'm getting there

Tell the owner of the code to split shit up.

I'm the same guy
I thought same as you.
Do you add the smalltalk in to reference a very integrated ide or postcard syntax or the oop abstraction ?

I fancied thinking of an emacs+smalltalk hybrid which I think to mean to boil down to what you said . Unrelated I also thought of a visual programming language that was all lisp under the hood .

Shame I can't learn to program to make anything.

smalltalk is erlang for brainlets

The most attractive attributes of smalltalk are really the image-based development and the simple syntax. The IDE can be developed as a set of plugins for emacs/vim/whatever you prefer: so long as the image itself supports sufficient introspection, an IDE is not necessary (and not being tied to a specific program to develop software is always good). Though being able to extend the IDE to become a program-specific GUI tool is insanely powerful. Just an easy example for other people following along: imagine being able to transform your programming IDE into a full-fledged 3D engine UI, including just adding a one-liner annotation to be able to use the UI to play with 3D object properties (texture, model, animation, etc.) with realtime updates of the 3D application.
As for visual programming languages, they are not interesting at all since they're too clumsy and inefficient, and tie you down permanently to an IDE with no possibility to use alternative software. Not to mention tooling complexity and how insane doing things like debugging non-trivial problems becomes with these chimeric constructs.
Erlang has precisely nothing on smalltalk.

Guys I think I have finally given up.
C really is garbage, outdated, senile garbage.
They dont even teach it in universities anymore

>find a language I really like
>all the IDEs for it are shit compared to mainstream languages
>the emacs plugins are pretty underwhelming
IDEs have spoiled me.

Attached: .png (800x600, 525K)

then fork, contribute or make your own language lemao

Any of you faggots coding in x86 assembly or high level assembly targetting DOS?
retro gems

I have a real job. If I had resources and time, I definitely would. Unfortunately I don't feel like using crap languages every day of my life while developing something good that would only ever be used by nobody since I would be too busy developing it to develop something with it that would only become viable in 60 years due to the amount of free time I have available.
At least my proof of concept already works so I know the ideas aren't too retarded.

>just make your own language

Attached: file.png (500x283, 51K)

Are people who can't program dumb

no but you are

No, they're journalists.

Are people who can't X dumb

reading this dumb thread instead of programming.
why do I do this? send help.

Attached: 1548382500594.jpg (1920x1080, 278K)

no, that's just you having superiority complex because you know some outdated, hipster, useless lang

very dumb post

you know it's true

I'm

>implying making a specialized tool is the same as making an universal standard
It's not.

How do I use awk to decrypt a rot13 encryption? I just made a Java program to solve level 11 bandit overthewire. I had to mess around with ASCII codes and stuff. There has to be a more functional way.

Learn Lisp.

What would be the fastest way to convert 32 bit binary number to string? Do I just do 32 multiplications in a for loop with power of i base 2 and add the sum?

Programming wouldn't be so bad if language designers would come together on a standardized way compile libraries so that any language could call into any other languages library. Like CFFI for instance.

>to string
To decimal

tr 'A-Za-z' 'N-ZA-Mn-za-m'

Not gonna work because the casuals will simplify everything

What do you mean?

C *is* the de facto standard here.

>Like CFFI for instance.
We could implement a call syntax specification format which compilers/interpreters can parse and adapt to.
Something like DWARF, it works great. But hopefully it's more generic.

Are you sure about that in a world where C++ and Java makes up the vast majority of codebases?

>implement
I'm betraying myself.
Specify.