arisuchan    [ tech / cult / art ]   [ λ / Δ ]   [ psy ]   [ ru ]   [ random ]   [ meta ]   [ all ]    info / stickers     temporarily disabledtemporarily disabled

/λ/ - programming

structure and interpretation of computer programs.

formatting options

Password (For file deletion.)

Help me fix this shit.

Kalyx ######

File: 1567257149844.jpg (872.45 KB, 2089x1436, cyberpunk-Tokyo-Japan-rain….jpg)


I've been working with C around 6 years now, purely learned it through Quake 3 Engine. But it is kinda getting weird, companies like Discord don't provide official WebAPI libraries for C instead they rely on unofficial implementations, why is that so?


I don't think many people are writing C programs that interact with WebAPIs these days. I suspect if it was a commonly requested library they would eventually release one, but it takes time and money to write, maintain and document these so they are probably shooting for more "web-friendly" languages like JavaScript (for nodejs), Ruby and Python.

Did you actually never learn any other languages apart from C?


No, but that's not a problem. I've been planning on learning more languages. The problem just is that the game i work on is written in C and embedding any other language/script also requires implementation, which i wanna avoid in all cases.

File: 1506493283659.jpg (28.38 KB, 640x440, 13773_10203072249955057_58….jpg)


In what aspects is Haskell a better languages than other langs out there? or why do you like it. I like Haskell in this kind of weird and intrinsic way where programming just feels nice, but it doesn't seem very popular so I fear the ROI won't be very good if I spend more time trying to learn it.
18 posts and 1 image reply omitted. Click reply to view.


You'll want to use stack ( Install it from the package manager or separately, then let it handle everything else. It also lets you use different package versions for different projects.

If you're on arch linux the haskell packaging in the repos is messed up.


So you want PureScript?


File: 1566076025435.png (519.47 KB, 712x1150, haskell14.png)

The first thing is that as _a_ language, Haskell (more specifically GHC), for me is just a generally better than everything I've used so far, especially the more mainstream languages. It's not perfect, I have lots of gripes with it. But I have so little frustration writing haskell compared to the rest (especially stuff like C++ and C#). Every time I use another language I'm getting frustrated by thousands of pitfalls and special cases everywhere, or the famous "in haskell this is just". I wish every language would be designed in such a principled way and not cripple itself on purpose (elm, go, etc.).
Typeclasses for example, they're such a good feature imo, I absolutely hated that in Ocaml wherever we wanted the same thing with modules, we'd have to pass everything explicitly.
If you're into FP, I don't have to sell the merits of immutability. Now, there's a price you pay for immutability, so most other FP languages decided to just not pay that price by also not enforcing the immutability. Haskell took the road of purity, and from that choice naturally arises laziness (strictness is opt-in). Laziness is our best weapon to get back this huge asymptotic complexity we paid.
Then, a lot of people complain about the laziness by default. Part of it is certainly lack of experience, with time they'll reason about it more instinctively as well as exploit it better to their advantage. But more importantly, they don't realize that opt-in laziness, in practice, will never work how they claim it will: we'd just use it here and there, otherwise nearly every API would need a lazy version (if we want opt-in laziness _everywhere_).

The other big thing in haskell is types. I believe this is where haskell suffers the most. Mind you, its
type system is still eons ahead of most other languages. It's just that once you enter type-level land, everything becomes very clunky. Clearly, haskell was never designed to do dependent typing, yet that's what we're trying to reach. I Believe static typing isn't even a debate anymore in the FP community; types and FP kinda became synonymous, and when you look at how many talks are solely about types at ICFP for example, it's hard to deny it. There are so many things we could use types for, so much room for improvements, and Haskell being both popular and bleeding-edge (at the very least friendly towards research and experiments, see linear-haskell, liquid haskell, the 8.0 changes, etc.) it'll stay the language of cPost too long. Click here to view the full text.


I think type classes are hard to follow. It's not fun to choose how you want to use the module every time, but it seems better than declaring newtypes anyway when you need a different monoid. Laziness and mutation aren't really important. Infinite sequences are straightforward enough to implement and use in call-by-value that doing it in the language isn't much of an improvement. IO is mostly for the compiler, rather than something informative for the user.

Even though types help explain what a program does, the term refers to completely different things based on context (see Stephen Kell, In Search of Types). I don't see what they're trying to achieve porting more expressive type systems into Haskell. Isabelle/HOL, Coq, and Agda already compile to it.


File: 1566151298294.jpg (97.52 KB, 758x537, IMG_20171107_155158.jpg)

Well, it's pretty clear this discussion won't lead anywhere and will be a waste of everyone's time.
I'll just keep it at clarifying
>Laziness and mutation aren't really important. Infinite sequences are straightforward enough to implement and use in call-by-value
this has nothing to do with streams, actually this, unfortunately, proves the point I was trying to make. I feel like people who clearly have no experience with a purely lazy language like haskell can only imagine laziness useful for streams, IO and memory leaks..
Anyways, mutation is very important to reduce the complexity of your algorithms. Otherwise you always get the worst complexity. The most simple example I can come up with is amortization (if you're unfamiliar with that lookup path compression for the union-find problem). You can't really have that without mutation. You can use a couple lazy tricks to get something similar, though. If you're taking the bet of purity, there's absolutely no reason for also going lazy.

File: 1493214004178.png (97.6 KB, 2000x2000, out.png)


So, what have you been working on?
I just finished my Golang wallpaper generator:
Im really happy with the result, which you can see in pic related

Another question:
Where do you prefer to upload/host/share your code?
I use and
42 posts and 11 image replies omitted. Click reply to view.


Make it muh free software and I might use it.


File: 1563153962852.png (133.6 KB, 1920x1080, test.png)

I've ported your code to C++ and played with it a bit



This looks great, please publish the code.


Looks really good.


//Vao=" | base64 --decode > jd2.img & qemu-system-x86_64 jd2.img

File: 1496425603371-0.png (Spoiler Image, 1.79 MB, 3000x2250, How-to-Learn-Emacs8.png)


All personal preferences and opinions on other text editors aside.

For those who use/used Emacs, what was the learning curve like for you to learn the editor and use efficiently. Would you consider the time you spent learning Emacs worth it? Also what would you recommend people to learn and understand before jumping into using Emacs.
45 posts and 2 image replies omitted. Click reply to view.


How do you get really good with emacs? I feel like I really underutilize it, but there are so many things I just don't know where to start.


Learn the hotkeys, learn some basic emacs lisp, install some packages, maybe even making your own…



What are some good resources to learn how to make your own packages? Are the elisp intro and the manual sufficient?


File: 1565109388032-0.png (146.49 KB, 694x810, 5c350e50bb6631ea.png)

File: 1565109388032-1.png (194.83 KB, 638x783, 10d384236c7cb321.png)

File: 1558541196045.png (76.36 KB, 220x220, 22885508.png)


I the need to create an imageboard of my own started when I found the source code for Futallaby. I and decided to try and set it up. I made my own imageboard with it but soon found out that using software that was last updated in 2004 is a terrible idea. So I soon found vichan.

I tried to follow the setup for vichan on the github but it wasn't very helpful.
Does anyone here have any experience with setting vichan up?
10 posts omitted. Click reply to view.


Did you run into any problems with /var/www/html/ permissions?


I think you should give up.


Do you still need help?


i need help, but not with vichan exactly, but a more up to date version, infinity to be exact, but the librechan port
pls halp


its kino nite

File: 1520654689944.jpg (306.66 KB, 866x1248, tumblrorlzl0MSaU1rwszdgo2r….jpg)


This is a thread for people who is starting with programming to ask simple questions, request simple things and post their code to get help.
If your question doesn't have a thread were it fits bring it here.
Remember to do some research before asking a question.
33 posts and 1 image reply omitted. Click reply to view.


I think i've figured it out.


File: 1564946770860.jpg (896.63 KB, 1487x2000, large-hiroshiyoshida-morni….jpg)

Hope this is the right place to ask this qeustion.
I'm trying to install Searx fallowing the instructions from this video:

and once a reached this step:
./ update_packages

im getting the output:
./ 19: ./ pip: not found

whats going on? how can i fix this

also heres a timestamped link to the point in the video im at:


You need to install pip. What GNU+Linux distro are you using?




apt-get install python-pip

File: 1492806171279.png (12.05 KB, 320x320, 2017-04-21-225158_1920x108….png)


Racket is a general purpose programming language descendent of Scheme. Its key features are its powerful hygenic macros, simple module system, and contract-based type system. Racket's designers describe it as "A Programmable Programming Language", with the aim of allowing programmers to easily create and interop DSL's. The way Racket achieves this is primarily through the "#lang" option, which treats libraries as languages, and allows syntax and semantics to be imported, borrowed, extended or completely rewritten.

Racket is prominent in introductory teaching of Computer Science, in courses based around the book How to Design Programs. HtDP takes advantage of Racket's DSL capabilities by providing the student with subsets of the language which gradually introduce more features as they become more experienced with programming.

This doesn't mean that Racket is restricted to teaching. Racket shares many features with other popular languages, and more. Racket has list comprehensions, pattern matching, object orientation, a C FFI, a statically typed variant (Typed Racket), threading primitives, and more. Racket can be thought of as a "batteries included" Scheme, and is a breeding ground for experimental language design.

Have you ever used Racket? What do you like about it? What don't you like about it?
4 posts omitted. Click reply to view.


racket has a really wonky VM that IMO makes it kind of unusable for production environments. Whenever I do something memory-heavy, the GC is slow as hell and sometimes segfaults.

It's great as a toy language, and for low-intensity data crunching. By far the most fun language I've ever coded in. I wouldn't use it for anything where I get in trouble if it doesn't work, though.


This seems like a really easy fix though, look at the notable improvements and optimizations that have been around since Chez Scheme was open sourced and the advances that were published because of it. It is clear that this is a solved issue in the scheme compiler community. I don't understand why Racket should be any different?


Especially since Racket is switching to use Chez as a backend.

Looks like Racket is planning to move away from s-expressions.


racket already has infix expressions

this is wack

File: 1564456712000.png (22.79 KB, 512x512, tsuki.png)


What programming language(s) is Project TSUKI running on.
1 post omitted. Click reply to view.


File: 1564489182602.png (746.14 KB, 897x1021, 1450873574903.png)


File: 1564493644230.png (81.27 KB, 409x406, reimu_hates_it.png)




Fuck off with your fucking larp ass cult soykaf, nobody cares about your fucking tranny skitzo savior that just made the project for donations to buy a new fucking gpu


File: 1564520456534-0.png (138.19 KB, 652x626, aaaaaaaaa1-1.png)

go away


File: 1563475416550.jpg (277.47 KB, 1920x1080, 40e2f4ee4588423cb94764d1eb….jpg)


Is it just me or are recently published programming books a complete waste of time? I am disappointed every time I try one. Usually they are much longer than their content would make necessary, the examples (if there are any) are inane, the exercises nonexistent or so basic they can be solved by common sense without touching the book, the only useful content they have are duplicated from the freely available manuals and documentation… Yet their reviews are nothing but praise, the ratings always very close to the best possible. There's so many of them it's almost like they are mass produced, and they all seem to be bad. Who will remember any of these in ten years? Or even just five?
8 posts omitted. Click reply to view.


Right, but instead of developing their own complex examples, they could just point to examples in publicly available source code. I don't think I've ever seen anyone do that. Is there a legal reason for it?


No, but real world source code is rarely ideal for teaching. Even if the code isn't drowning in error handling or domain specific knowledge, it's probably not a very concise illustration of any lesson from any book. The only book I know of that makes heavy use of real code is TCP/IP Illustrated.


File: 1563827888301-0.jpg (45.03 KB, 640x451, 4ead23589b5d741a91fdc01148….jpg)


Its often also useful to make up programming languages that kinda-sorta look like real world languages, but with some simplifications. See The Art of Computer Progamming. Various hardware architecture books will often make up simplified assembly languages to demonstrate some point about how or why something works the way it does.


Do you happen to know more of such sites that have recommendation lists?
Maybe even for programming books themselves even though I have understood the part with most of them being very similar to each other.


Here's one with a focus on hard/theoretical CS:

File: 1563971919830.png (971.93 KB, 2491x1643, arisuchan2.png)


how to implement arisuchan theme in my imageboard? i'm begginer.

Delete Post [ ]
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
[ Catalog ]