[ cyb / tech / λ / layer ] [ zzz / drg / lit / diy / art ] [ w / rpg / r ] [ q ] [ / ] [ popular / ???? / rules / radio / $$ / news ] [ volafile / uboa / sushi / LainTV / lewd ]

λ - programming

/lam/bda /lam/bda duck
Name
Email
Subject
Comment
File
Password (For file deletion.)

BUY LAINCHAN STICKERS HERE

STREAM » LainTV « STREAM

File: 1447177267517.jpg (325.03 KB, 1280x1244, 1447152696651.jpg) ImgOps Exif iqdb

 No.11820[Reply]

Is it good taste that makes the great programmer?

You can frequently hear mathematicians talk about the beauty of certain proofs and the whole of mathematics. Some even claim that to be a good mathematician, knowledge and skills are not enough, you need a sense of aesthetic pleasure in mathematics.

Is there something similar in programming? I can certainly appreciate the beauty of well-written programs and notice the ugly. But it is actually important? Shouldn't it just work?

If it's actually important, we are doing it so wrong. Very few courses or books talk about beauty, and even if they do, it's syntactic at best. It would also mean that we need to focus a lot more on collecting, studying and imitating great code.

What do you think?
19 posts and 3 image replies omitted. Click reply to view.
>>

 No.11934

Beauty in programming for me is being able to control complexity and making your program readable.

>>

 No.11939

>>11914
Tail recursion often forces you to write less beautiful code, though.

>>

 No.11950

File: 1447447396735-0.png (51.23 KB, 1201x226, ide.png) ImgOps iqdb

File: 1447447396735-1.png (98.22 KB, 1246x708, ide comments.png) ImgOps iqdb

>>11922
The colorForth website was down when I posted earlier, but now I can show this:
http://www.colorforth.com/ide.html

Just look at the simplicity of this driver. Look at how simple and to-the-point the comments are.

This is beautiful code. This is simple code. This is readable and modifiable code.

This is correct code.

>>

 No.11954

>>11939
not true. Just put everything you need to iterate through in a list and you're ready to go.

>>

 No.12450

>>11954
that lets you turn iteration into (tail) recursion, but for sufficiently intricate recursion, the only way to make it tail recursive or iterative is to effectively implement your own call stack on the heap.



File: 1448955331419.png (55 KB, 210x273, ib2z9ME9QKEBaS.png) ImgOps iqdb

 No.12435[Reply]

Hey lain. Thanksgiving just passed, so let's be thankful. What's done software your thankful for?

For me it's django, notepad++, terminator, and just Python on general.
7 posts omitted. Click reply to view.
>>

 No.12445

Zsnes, I still love you.

>>

 No.12446

I'm thankful for a heck of a lot of software, but just recently I'm most thankful for Vim + YCM, GCC, Clang and Freeglut.

>>

 No.12447

Thanks Windows. You the real mvp.

>>

 No.12448

>>12447
seriously, it's cool to soykaf on windows these days but I'll bet the vast majority of people here would not be nearly as interested in computers if it wasn't for some version of windows they messed about with as a kid.

also win 98 has the best boot sound in history. Probably just nostalgia on my part but it just takes you back to when a computer really was a magic box that could do anything.
https://youtu.be/tajDxBaPBBM

>>

 No.12449

Moved to >>>/tech/14494.



File: 1431301001154.png (49.19 KB, 1000x716, url.png) ImgOps iqdb

 No.5965[Reply][Last 50 Posts]

Let's have a proper Haskell thread!
Post learning resources (beginner & advanced), neat tricks, stuff you wish you'd have known about sooner or simply talk about Haskell projects you are working on.

Currently reading the Haskell WikiBook at http://en.wikibooks.org/wiki/Haskell
I personally prefer it over lyah since lyah lacks exercises (I still skim through it since it is fun to read).
I also plan to work through "Thinking Functionally with Haskell" by Richard Bird, are there any opinions on this?
172 posts and 22 image replies omitted. Click reply to view.
>>

 No.12385

>>12363
>If you have any specific points you want to discuss, bring them up.
I wanted to read the first tutorial from the 90s, but it wasn't available.

My understanding is now that monads support returning values and also feeding them into other computations with >>=.
I've read that you can add on to this, although not shown how you can, to get state, IO, and exceptions.
From this, I've been told that monads let you create an environment that only has what you need.

That sounds interesting and reminds me of the package system in Common Lisp. I can avoid including whatever features I want in a package. I can also modify the read table global variable to disable access to features. It would be possible to replace Common Lisp's exception system with my own by aggressively creating such a package and access to certain datatypes can be restricted easily by simply disallowing use of functions and reader macros that create them.

>>

 No.12386

>>12385
>I wanted to read the first tutorial from the 90s, but it wasn't available.
Weird. I seem to have had it in cache, but after flushing, the server doesn't respond. It's in the Archive anyway: https://web.archive.org/web/20150423203821/http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf

>>

 No.12390

>>12385

Here's how you (could) define a state monad:

newtype State s a = State { runState :: s -> (a, s) }


"State s a" is a box containing a function of type "s -> (a, s)", which can be extracted with "runState". So here, the "state" is a represented as a single value: you supply an initial state, and you get back a result and a final state.

instance Functor (State s) where
fmap :: (a -> b) -> State s a -> State s b
fmap f sa = State $ \st -> let (a, st') = runState sa st in (f a, st')


The Functor instance lets you apply a function to the result value, possibly changing its type. It doesn't let you do anything to the state value though. This is because Functor has kind "* -> *", whereas "State" has kind "* -> * -> *", so the first type parameter needs to be fixed.

instance Applicative (State s) where
Post too long. Click here to view the full text.

>>

 No.12392

>>12385
Don't try to "understand" monads, because like many other abstracts constructs, they are -semantical- definitions. That means that they allow many implementations, which differ a lot in nature. It's like trying to define a "machine", it's not really useful.

In Haskell however they have a very practical side. You can see a progression.

- Type constructor : `F a` creates a context `F` with values of type a.
- Functor: You can apply functions inside this context.
 f :: a -> b => fmap f :: F a -> F b 

- Applicative: You can use in-context functions.
 f :: a -> b => F f :: F (a -> b) => (<*>) F f :: F a -> F b 

- Monad : You can apply functions with produces contexts inside contexts
 f :: a -> F b => (=<<) f :: F a -> F b 


Given this machinery, you can see their utility. But trying to reduce these concepts to a metaphor is just restricting their nature and utility.

>>

 No.12424

>>12360
>Anything abstract can be boiled down slowly to less abstract concepts.
Like with any programming concept, it's easier to describe how the thing *operates* than explaining what it actually *is*. Defining the concept of a "function" in a concrete and exact way is what gives you the whole field of denotational semantics. Anything less is metaphorical and dishonest.

You can however explain how to use functions, what a particular function does and even how to make your own. Same goes with monads: You use them with "do"-notation or the >>= operator, they often have a clearly defined interpretation as a style of effectful computation, and defining your own requires you to define a way to "put things into the monad" and to "flatten nested monads", which can mean different things depending on your particular case.

Of course, sometimes the metaphorical handwaving can be useful for beginners. Saying "functions are sort of like mathematical functions" at least gives somewhat of an intuition how to approach them. IMHO, the best metaphor for monads is that of a recipe for an effectful computation, even though it's certainly not applicable in all cases. Read some early (but not too early) papers and tutorials from the list in >>12363.



File: 1436301635053.jpg (32.87 KB, 600x400, java-logo-blue.jpg) ImgOps Exif iqdb

 No.7343[Reply]

Any and all Java questions and discussion here. Do RTFM when in doubt. If you did RTFM but are still confused or it didn't have enough classes to get things done, this thread is for you.

>RTFM

https://docs.oracle.com/javase/8/docs/

It's a big language that tends to cause a lot of frustration when least expected, while still being one of the most demanded skills in information technology.
17 posts and 1 image reply omitted. Click reply to view.
>>

 No.10685

>>10683
Probably more efficient too

>>

 No.10703

>>10683
>>10678
thanks both of you! very new to java, il have to look more into arrays and lists.

>>

 No.12323

Most of the Java code I've seen is pretty bad.

I always see so many lines dedicated to nothing but satisfying an interface requirement.

Would someone here show me an elegant Java program?

>>

 No.12400

>>12323
The power of Java is that it is a bad language. There are no shortcuts; completing a task that should only take 10 lines might be 100 lines. This apparent cost has a few advantages. The first is that one can spend a day programming Java, producing a great amount of code, without having to do much thinking. That is to say, the code to thought ratio is very low, while in languages like Haskell or Lisp it is very high. Another advantage is readability and debuggability- because of how little is possible within the language, the purpose of code is immediately apparent. Java is actually very readable as a result, though it may seem tedious because it is difficult to write.
tldr there isn't any elegant Java and there can't be any elegant Java

>>

 No.12423

>>12400
>there isn't any elegant Java and there can't be any elegant Java
This was the answer I expected.



File: 1443079867768.jpg (10.69 KB, 626x172, 89702.jpg) ImgOps Exif iqdb

 No.9771[Reply]

https://volafile.io/r/kUFzLJ

Come on in, share something with the others, Lain.
76 posts and 4 image replies omitted. Click reply to view.
>>

 No.12387

File: 1448575593175.pdf (1.6 MB, ARM Assembly Language Prog….pdf)


>>

 No.12395

>>12387
muchas gracias mi familia, or as they say on the 'net, "ty fam"

*tips sombrero*

>>

 No.12404

>>10534
protip for people using this: pipe lynx output to tac to download old files first

>>

 No.12421

>>12395
yw pedro

>>

 No.12422

>>12404
>>10534

I recommend the Firefox/Iceweasel addon "Copy Link URL" which enables you to select and copy the URL of multiple links at once.
This in correlation with a download manager like JDownloader will make it possible to essentially download all files in a room with two clicks and some scrolling.


Related to this: I spend the last two days uploading a few thousand fiction books (mostly sciFi and Fantasy, both classics and contemporary) which I recently discovered on my harddisk.
Since I dont normally read anything besides textbooks, I have deleted them from my computer, so you might want to download them within the next 3-5 days.



File: 1399453189739.png (540.48 KB, 1280x720, madoka_reaching_satori.png) ImgOps iqdb

 No.190[Reply][Last 50 Posts]

What books should every programmer read?
271 posts and 85 image replies omitted. Click reply to view.
>>

 No.12398

File: 1448687335635.jpg (38.64 KB, 374x347, 1438569416363.jpg) ImgOps Exif iqdb

>>12397
You're asking strangers on the internet to direct you to the hardest coq they can find?

>>

 No.12401

>>12398
That sounds so dirty.

>>

 No.12402

>>10360
>Do you happen to know of a good introduction?
Benjamin Pierce's 'Software Foundations' is great: https://www.cis.upenn.edu/~bcpierce/sf/current/index.html
There's a new text in preparation, too, 'Programs and Proofs: Mechanizing Mathematics with Dependent Types' by Ilya Sergey: http://ilyasergey.net/pnp/ It's decent so far.

>>12397
Have you read Coq'Art?

>>

 No.12406


>>

 No.12419

>>12402
>>12406
>People taking this seriously.



File: 1447715713851.jpg (299.79 KB, 800x560, Jen.(Fisheye.Placebo).full….jpg) ImgOps Exif iqdb

 No.12043[Reply]

So I used to communicate with the programmer of morphis but hes disappeared for about 2 months now. Morphis didnt get any press coverage and barely has anyone who knows about it.

Morphis already works as a distributed datastore and deprecates email. There is a distributed, fully encrypted, email replacement built into morphis and you can upload anything. morphis detects when you upload html and allows you to create free distributed webites.

I think it'd be really smart for lainchan to look through the code and experiment with it and test it out because this has huge potential but was barely ever given a chance.

https://morph.is/v0.8/

lets share some uploads here and see how fast it can get when we have a lot of connections. also, share Dmail keys.

To run download from morph.is extract to a folder, open terminal in folder and run ./run.sh

if you need sqalchemy use pip3 install sqalchemy

also check the readme
Post too long. Click here to view the full text.
27 posts and 3 image replies omitted. Click reply to view.
>>

 No.12320

>>12318
the difference is how long the data has to last, and that makes all the difference.

>>

 No.12340

>>12230
Guy planned properly. Unfortunately, that plan apparently was needed.

>>

 No.12369

My Dmail:
rpcem3mc79doxbjmdo8uzdqrg6bwtecjzx67sqkbzn1yg9x4gean3b441odfyxsm36z6f85diqdd4d7aecrixe9p3uspudew6hoej4a
This Dmail thing alone is fuarrrking great. Give it a try, it has a lot of potential.

>>

 No.12370

>>12043
>Dmail
El. Psy. Congroo.

>>

 No.12399

The dmail interface is actually really nice.

9qy8a5aqaity1j31oyqnzjojfntzhwjxh8uhxnbfc5yiaq7854uupr1euc9e44z7ocwo6p1biorfxgihq7sbt8dnsrwn7bcbdwmrb7a



File: 1447106588248.jpg (215.87 KB, 1080x1776, Snapchat-54395126584576576….jpg) ImgOps Exif iqdb

 No.11783[Reply]

What if you had ChromeOS, but...

* all documents were stored on a distributed darknet like freenet, or in LAFS grids?
* all messaging apps and systems were secure by default (tofu), and could be verified to get from default to known secure?

This is more engineering than lam, but how could this work?

Pic not related.
3 posts omitted. Click reply to view.
>>

 No.11792

>>11789

One step further - there should be dark-cloud webapps to replace all ChromeOS features.

The way ChromeOS does this is only using browser based technologies; we could do the same if there was a Javascript app that back ended to freenet or similar.

>>

 No.11795

>>11789

personally i always need internet for work. well i dont but i get frustrated and inefficient quickly. LTE everywhurrr fuarrrk yeah i use like 60GB/month sometimes
i though about saying so fuarrrk it just do a network file system but then i realized it's a stupid idea


instead what you want some kind of truecrypt container which is synced smartly (not the whole thing every goddamn time you change one file) when you choose to.

you could choose what to sync and when and if you want to keep a local encrypted container copy on disc for offline work or if you want it whiped when you shut the machine down.

yeah im starting to like this idea op

i'd say you'd host the web apps on your home server or inside the encrypted container.. i mean if you want social network soykaf you will have to connect to tor or peer to peer stuff anyway

>>

 No.11837

>>11795
I think for Google drive like features, you could just use freenet, or a LAFS grid for more speed/less anonymity.

>>

 No.11838

>>11795
Ideally, you only need the local client; the app "server" is a set of dumb storage that's decentralized and anonymous.

I think a good goal for this is to have a live CD+service keys give you your normal work environment.

>>

 No.12388

From a technical standpoint there isn't much interesting about chromeos, though they do have some interesting CRDT stuff for group editing. Most of the software is already there except the glue to hold it together. It's just there isn't a huge corp to make it sexy and the "muh freedoms" types aren't very interested in making cloud-type services more convenient.



File: 1448038502135.png (395.86 KB, 819x643, lan.png) ImgOps iqdb

 No.12169[Reply]

I'm making a Visual Novel, and was wondering if anyone would be interested in contribooting.

It's about Lain Iwakura, a Japanese exchange student who transfers to MIT. When she arrives, she meets none other than her classmate RMS. They develop a complex, almost abusive relationship with interesting dynamics.

Plus it has 100% of your daily recommended memes.

Living in the fast Lain.

Any suggestions are highly welcome!!
48 posts and 9 image replies omitted. Click reply to view.
>>

 No.12307

File: 1448281925150.pdf (12.56 MB, Steven Levy - Hackers Hero….pdf)

>>12306
that was only a small excerpt from the actual book I wanted to post, sorry.

>>

 No.12313

>>12304
That seems too serious, and the whole thing is basically a way for me to wedge memes.

Feel free to fork it and do what you suggest, but Uni means I don't have much time to work on it and I kinda want to keep it short and stupid.

>>

 No.12317

>>12313
Which Uni?
Is it perhaps MIT?
Are you staying in Baker House?
Have you met Lain?
>btw Baker House does not have single rooms for freshmen. I don't know if Lain would be considered a freshman because she transferred but, I thought I'd let you know.
Did you fuarrrk her along with 10 other men. I need to know.

>>

 No.12342

>>12317
I googled "MIT dorms" and it was the first I found

>>

 No.12384

Yeah definitely images of young hackers! However, they need to be in color.



File: 1427317232833.png (6.5 KB, 900x506, freebsd_wallpaper_revisite….png) ImgOps iqdb

 No.5248[Reply]

Post some cool tricks in C or Makefiles
48 posts and 1 image reply omitted. Click reply to view.
>>

 No.12335

>>12333
Like a C compiler, the site aggressively modified the final post.

It is --> and <--.

>>

 No.12338

Q: Why is it called C?

A: Because "This won't work in neihther C++ nor C#. See, I told you so!"

>>

 No.12373

>>12338
Q: Why is it called C++?

A: You take C, add to it, and use the old one.

>>

 No.12378

>>12335
Isn't
i --> 0
the same as
i-- >0
?

>>

 No.12381

>>12378
Yes, to the compiler



Delete Post [ ]
[ 1 / 2 / 3 / 4 / 5 / 6 / 7 ]
| Catalog