Programming @4-ch

Programming @4-ch

Be it HTML, C++, Java or whatever language you prefer, programming is what we do best around this board.
Markup languages are also fine around here, as with all the "not so real" languages of Shell script, CSS, and other various third party scripting languages.
  • We are sick of language discrimination, more so the PHP/Java bashers. There will be little tolerance of blatant and repetitive insults. You are still welcome to bring forward a sensible, insult-free argument regarding a certain topic at the appropriate time and place for it.
  • Please use WakabaMark or the appropriate HTML tags (with HTML enabled, of course) to format your code.
Rules · 規則
Board look: Blue Moon Buun Futaba Headline Mercury Pseud0ch Toothpaste

suckless unix tools (4)

1 Name: #!/usr/bin/anonymous : 2015-11-27 23:38 ID:WnYu4pRm

2 Name: #!/usr/bin/anonymous : 2015-11-29 01:41 ID:Heaven


No thank you!

3 Name: #!/usr/bin/anonymous : 2015-11-29 11:04 ID:lcFEsEzJ



4 Name: #!/usr/bin/anonymous : 2015-11-29 21:44 ID:F+2cOlTz

i dont trust them

Name: Link:
Leave these fields empty (spam trap):
More options...

【Unix】new unix file types (12)

1 Name: #!/usr/bin/anonymous : 2015-07-10 22:20 ID:t1CnYWeK

I was thinking of some file types that afaik don't exist.

One is filesystem entries of files stored in memory from disk files, updated when the disk file modification time changes. This would be a big disk-access optimization in some cases.

The in-memory entry permissions would be ignored, and writing to it would write to the disk file.

Another one is dynamic files that (only) have the name of a executable, which when opened would be executed by the kernel, creating a process child of init with its standard output piped to the file descriptor obtained by opening the dynamic file.

Here reading would depend on both the dynamic file's read permission and the named executable's execute permission. The idea is that it's transparent to the reading process.

Whether they could change the file to which they point to without deleting it would depend on the implementation, I think. (

3 Name: #!/usr/bin/anonymous : 2015-07-13 21:27 ID:E2Za6msF

Unix is programmable, you can change it not to suck.

Everything else sucks more, and you're stuck.

4 Name: #!/usr/bin/anonymous : 2015-07-14 17:51 ID:rdeMslMg

Yeah, you can spend your tine and effort on trying to graft usability onto a crusty design built to run mainframes in the 70s, like the Linux fags have been trying and failing at for the past two decades, or you could try to make an OS that actually makes sense for desktop use instead.

5 Name: #!/usr/bin/anonymous : 2015-07-15 18:10 ID:uZcCDWHA


6 Name: #!/usr/bin/anonymous : 2015-07-16 09:23 ID:dj2rH73R

I was gonna make an OS that like totally made sense super intuitive wouldve changed the desktop forever but I got stuck at implementing jishin/kashin.

7 Post deleted.

8 Post deleted.

9 Name: #!/usr/bin/anonymous : 2015-11-21 13:35 ID:RwpAX7+c

The first type is called mmap, and caching like that is done automatically by the kernel.
The second type, if I understand correctly, is a script glued to a fifo.

10 Name: #!/usr/bin/anonymous : 2015-11-25 07:02 ID:7Yv7jdnv

Oh yeah kernel caching.

>The second type, if I understand correctly, is a script glued to a fifo.

That's rather rudimenary. For that you could just serve virtual files. My idea was that the writer and reader programs didn't have to know about this, but, now that I think about it, that just reading might execute something is probably too wild.

11 Name: #!/usr/bin/anonymous : 2015-11-27 23:45 ID:3TgAyWOw

Oh, I see. So opening the file would implicitly start its target program, and read/write operations on the file would redirect to stdi/o. How would you change the target program?

Perl uses this idea - opening a subprocess is identical to opening a file, but the filename begins with a pipe.

12 Name: #!/usr/bin/anonymous : 2015-11-29 02:15 ID:C+mJgx35

>How would you change the target program?

Similar to changing other files, probably.

>Perl uses this idea - opening a subprocess is identical to opening a file, but the filename begins with a pipe.

Kinda like the POSIX popen interface, yeah. But having to use special interfaces or languages falls short of transparency.

Name: Link:
Leave these fields empty (spam trap):
More options...

[Sharing]Your personal projects[Inspiration] (27)

1 Name: #!/usr/bin/anonymous : 2014-11-08 13:20 ID:p3iUEkWT

What are your (current) hobby projects? What languages or libraries are you using? How usable or complete is it? What makes what you're doing novel or great?
No need to be smug or anything, or get all angry at other people for using <thing you hate>. Just share what you're up to. Add a URL if it's public too, if you want.

I'll start. I'm writing a stack-based language in Racket for use in embedded devices. It's already got Hindley-Milner style type inference, it just needs to actually produce output.
I'm also planning a modal text editor that feels like vim and a music-making program somehow.

But enough about me. Let's get some actual content on the front page of /code/.

18 Name: #!/usr/bin/anonymous : 2015-10-07 22:02 ID:+dNPQwqQ

it's one 10 thousandth of the length in code size, im happy about that

19 Name: #!/usr/bin/anonymous : 2015-10-07 23:01 ID:dYrcMMp+

code size is nothing, show me the binary

20 Name: #!/usr/bin/anonymous : 2015-10-20 12:42 ID:2+K00MaM

I'm maintaining one of those item database sites, that every MMORPG has. Made it, because the most popular database site for this game was closed down, due to lack of revenue.

Was a fun project, figuring out how the game stores data, finding a way to mod the game, JavaScript with AngularJS, C# on backend, a bunch of SQL.

Haven't had much willpower to work on it lately though.

21 Name: #!/usr/bin/anonymous : 2015-11-09 12:47 ID:4gR4p9A5

You can check out my project here:

I bet you won't know what it runs on. ;)

22 Name: #!/usr/bin/anonymous : 2015-11-14 20:46 ID:l7z+nN31

PHP 5.5.9?

23 Name: #!/usr/bin/anonymous : 2015-11-14 20:50 ID:l7z+nN31

Also, I'm practising FRP. Making an incremental game with it, and smashing lambda-term (ncurses but not shit) together with React (OCaml).

24 Name: #!/usr/bin/anonymous : 2015-11-15 02:08 ID:MY7Tgx2S

It's nice reading about you guys projects :)

I'm making a scheme macro system

25 Name: #!/usr/bin/anonymous : 2015-11-26 19:58 ID:0ZToqfam

Sounds cool, you should post it some time if it's ever ready.

26 Name: #!/usr/bin/anonymous : 2015-11-27 00:21 ID:ww6/FqAn

>ncurses but not shit


27 Name: #!/usr/bin/anonymous : 2015-11-27 23:19 ID:6rUPkWO3

Understandable. Pretend I called it a terminal manipulation library instead. It's got nice things like double buffered treat-it-like-a-bitmap-image-basically drawing, proper text edition and a widget library.
The incremental game has lost my interest in favour of this. My main effort is going into figuring out how to make a reactive TUI without feedback loops (e.g. editable text field widgets, and widgets wrapping other widgets that can tell each other what dimensions to be).

Name: Link:
Leave these fields empty (spam trap):
More options...

Beginner programming. (21)

1 Name: #!/usr/bin/anonymous : 2015-02-07 23:35 ID:Y+JE2qHF

Know absolutely nothing about programming but want to learn etcetera...

Used computers all my life but know nothing about the codes inside them. I keep coming up with ideas for computer programs which are based on a few simple tasks or calculations which I think a computer could do but I have no idea how to implement them. I think I should get to the level of making a simple card game or something. Then work my way up to making scripts, something that could open up opera browser, search through a site for certain links, open them up and search for pieces of text and put them into a spreadsheet. That would be useful for my stock market research.

For now though I am a complete pleb and don't even know what software I need or how to take the first step. Here are some links I found that I will look at.

Post too long. Click to view the whole post or the thread page.

12 Name: #!/usr/bin/anonymous : 2015-03-06 03:34 ID:aA36YNO1

>Maybe it could teach me to use "precision magnets to manipulate the individual bits in your RAM and write programs in raw machine code."

umm I don't think that was completely srs

13 Name: #!/usr/bin/anonymous : 2015-03-13 04:51 ID:xr+lMDB5

I'd recommend "How to Design Programs", and if you'd like and have the time, you can supplement with "Structure and Interpretation of Computer Programs" lectures.

>Also I have heard from many sources that programming is more about constructing programs and less about memorizing code, this raises my confidence a little, assuming I am imagining what coding is like correctly.

The focus of How to Design Programs is on program design and construction, and the language it uses is very simple and requires no significant syntax memorization. It's also free and there's an IDE developed for it and the language it's based off of (Racket Lisp).

SICP is a highly-recommended book, but it's also very abstract and can be difficult, but it can be nice to watch the lectures and take notes and see how the ideas are used in HtDP. This is what I've been doing myself, I just started myself a few weeks ago.

I kind of wish there was some kind of beginner's programming IRC room or something for people like us.

14 Name: #!/usr/bin/anonymous : 2015-03-15 23:10 ID:aa0qzQFE

learn to program by programming, duh

sicp is overrated abstract bullshite
this is a point that no one may contest

15 Name: #!/usr/bin/anonymous : 2015-03-16 00:11 ID:xr+lMDB5

What makes you think that recursion vs. iteration and their benefits and disadvantages, the differences between the environmental and object-oriented models of programming, functional programming, and data-directed programming, and knowing how compilers work by writing your own are "abstract bullshite"?

At the risk of being too obvious, it DOES deal a lot with the structure of programming, and that's why I recommended it as a supplement to a more pragmatic or less abstract book if you have the time. You can always just read it afterwards.

16 Name: #!/usr/bin/anonymous : 2015-04-17 18:22 ID:ZXIFkahR

going to try codecademy, also found this theory about ADHD predominately inattentive which might yield something useful

17 Name: #!/usr/bin/anonymous : 2015-04-24 00:58 ID:ZXIFkahR

found this, it is very compelling evidence that I can increase glycogen (important source of energy) levels in the brain through exercise

I believe I need to sprint and do some other intensive exercises that use every muscle group in order to "hit the wall", the point where energy reserves are depleted and the body starts to deplete energy from other reserves like the brain. In theory this will trigger the body's natural reaction to increase energy reserves in the brain as well as skeletal muscle and mitigate the effects of ADHD-PI somewhat.

18 Post deleted.

19 Name: #!/usr/bin/anonymous : 2015-09-11 22:32 ID:Heaven

what the fuck is this shit del

20 Name: #!/usr/bin/anonymous : 2015-11-12 14:14 ID:U8bJXUUK


Recently downloaded this.

Currently reading this.

I still have ADHD-PI but a combination of psychology and a drink I make from instant coffee and cococa powder is helping me focus. As I may have mentioned earlier, I can concentrate on some things like a strategy game I have an obsession with, learning about every detail of the game and creating spreadsheets and things to help make decisions, but with other things I can barely read for a minute before my brain grinds to a halt. I am currently trying to transfer my obsessive behavior onto programming with some success but at the moment compared to an average person my performance is still very poor.

Post too long. Click to view the whole post or the thread page.

21 Name: #!/usr/bin/anonymous : 2015-11-12 14:37 ID:U8bJXUUK

Name: Link:
Leave these fields empty (spam trap):
More options...


1 Name: #!/usr/bin/anonymous : 2013-08-21 00:26 ID:E1O1alV+

'-._ ___.....___

`.__           ,-'        ,-.`-,
`''-------' ( p ) `._ HAVE YOU HAXED
. \

................._ --...--,

                 `-.._         _.-'


2 Name: #!/usr/bin/anonymous : 2013-08-21 10:45 ID:0o+BK5LS

what are you doing here? they deleted the shelter thread

3 Post deleted.

4 Name: #!/usr/bin/anonymous : 2015-09-20 00:09 ID:u3CKxn+M

good job

5 Name: #!/usr/bin/anonymous : 2015-09-27 09:42 ID:Heaven

I've been to that board, and for God's sake what a bunch of shit-posting that turned into.

6 Name: #!/usr/bin/anonymous : 2015-10-07 22:03 ID:2bfjSZDH

if you see it as shit posting you have not ascended yet..

first try to engage in "shit posting" and then you might understand it better

Name: Link:
Leave these fields empty (spam trap):
More options...

Applescript (15)

1 Name: #!/usr/bin/anonymous : 2006-03-05 07:28 ID:xrLD1Ox8

Somebody else use it?

I really hate the language itself. It's probably the only language where it is easier to read scripts than to write them!

Applescript uses a natural language metaphor, which is a fancy way of saying that all the syntax is made up of arbitrary keywords, some of them actually being documented.

Here's an example of code lifted from the wp page about AS:

set pix to 72
set answer to text returned of (display dialog "Enter in the number of inches" default answer "1")
display dialog answer & "in = " & (answer * pix) & "px"

It is too hard for the non-programmer, because I really can't see how this way of using natural language could make coding easier, and it is also hard for normal coders, who are always trying to find out which magic keyword is used to abstract what they'd like to work with. It just is easier to read.

Post too long. Click to view the whole post or the thread page.

6 Name: #!/usr/bin/anonymous : 2006-03-05 22:39 ID:Heaven

> I've used Automator for a few things; that's a bit more logical to work with, but much less powerful, unfortunately.

It really, really needs conditional logic.

7 Name: Albright!LC/IWhc3yc : 2006-03-06 03:52 ID:3uz8itvA

>>5: Well, the official site ( ) says

>JavaScript OSA provides full support for sending and receiving AppleEvents that leverages the AppleScript support found in the MacOS and the ever growing range of scriptable applications.

So it looks like it might just be a drop-in replacement for AppleScript that still provides the same functionality. I'll give it a more thorough look-over after work; this might be really cool.

8 Name: #!/usr/bin/anonymous : 2006-03-06 12:46 ID:Heaven

Automator is good for putting in a "Run Shell Script" action, and letting you do Perl scripting from inside the Finder, but not much else.

9 Name: #!/usr/bin/anonymous : 2006-04-12 04:39 ID:KXa9HDWK

I use applescript all the time. It's great for use with Obj. C applications (for talking to other apps.) Also good, as the above poster said, for running shell scripts etc.

10 Name: #!/usr/bin/anonymous : 2006-04-13 18:05 ID:7RBRFYpB

I have tried Javascript OSA. It can be used as a replacement for Applescript, but you still have to deal with Applescript limitations.

Would somebody know first-hand whether you can use PyObjC or RubyCocoa for small mac scripting, or is it only worth it for small apps?

11 Name: #!/usr/bin/anonymous : 2006-04-29 20:39 ID:RruUBGta

several ways to do the same thing, quirky non-uniform syntax, not small and consistent, imo it doesn't achieve true complete practicality in anything. scales very badly to very large projects. it's odd, but nonethless mediocre too. if you are interested in scripting languages, even if they are not perfect either, go for python and especially ruby; good balance between elegance/minimality and practicality. otherwise (if you like compiled would-be strong-type-checked languages ) go for java or .net if you don't need strict control in what happens with memory or precise performance features; otherwise, the "too-complex-but-very-effective" c++. good luck and tell us what you discover and think ;-)

12 Name: #!/usr/bin/anonymous : 2006-04-30 23:10 ID:Heaven

This kind of smells like what we used to have on the Amiga, starting from operating system version 2.04 onward. ARexx. The glue language that actually put applications together in a very reasonable way. Not quite Rexx as the poops at IBM imagined it.

Wonder why no one's come up with a working analogue to it yet.

13 Name: #!/usr/bin/anonymous : 2006-05-02 12:39 ID:f9oHo2/q


AppleScript is a working analogue to it. It's just that the syntax is horrible.

14 Name: #!/usr/bin/anonymous : 2006-07-18 22:13 ID:Heaven

Kind of what I meant.

15 Name: #!/usr/bin/anonymous : 2015-09-17 21:13 ID:DEDFZicZ


Name: Link:
Leave these fields empty (spam trap):
More options...

How do you motivate yourself to learn (3)

1 Name: #!/usr/bin/anonymous : 2015-09-14 11:00 ID:ravr0/GJ

I want to be a professional programmer because I'm under the impression programmers don't have to speak that much. The only programming language I know is Java because I took a few classes. I liked learning Java, and it came easy to me, but even though I want programming to be my job, I don't want to learn any more-- I prefer drawing manga pictures (which I'm bad at). What should I do?

2 Name: #!/usr/bin/anonymous : 2015-09-15 06:07 ID:eVO8uri8

remove your ribs and try to get your own penis into your mouth :)

3 Name: #!/usr/bin/anonymous : 2015-09-15 15:18 ID:wlWuGn/k

speaking is fun nigga

Name: Link:
Leave these fields empty (spam trap):
More options...

UNIX redone (250)

1 Name: dmpk2k!hinhT6kz2E 2005-06-04 11:30 ID:IaN0/d9q

We’ve all used UNIX or one of its derivatives. A lot of us use it for development and server applications. Quite a few of us love it. And I’m sure we’ve all got things we hate about it too. Is it time for a new Unix-Hater’s Handbook?

I have a few bones to pick:
a) Inconsistent command-line options:
Most programs use -- in front of their options. For example, mc --version. Some don’t, like dd, find, and other utilities from the Stone Age.

(backward compatibility, blah, blah, blah, it’s been several decades, blah, blah, blah)

b) Directory structure:
Yes, we’ve all heard the reasons why there’s a /bin, /usr/bin, /usr/local/bin, and /usr/local/*/bin, or why there are multiple library locations, or why there’s a /usr and /usr/local, etc. So what?

Post too long. Click to view the whole post or the thread page.

241 Post deleted.

242 Post deleted.

243 Post deleted.

244 Post deleted.

245 Name: #!/usr/bin/anonymous : 2009-01-16 22:30 ID:Heaven


246 Name: #!/usr/bin/anonymous : 2009-01-16 22:31 ID:Heaven

`multline \

247 Name: #!/usr/bin/anonymous : 2009-01-16 22:32 ID:Heaven


248 Post deleted.

249 Name: #!/usr/bin/anonymous : 2015-09-09 11:32 ID:Heaven

ugh make a new thread if you want to continue >>1's topic

250 Post deleted.

Name: Link:
Leave these fields empty (spam trap):
More options...

GameBoy Color emulator in JavaScript (19)

1 Name: #!/usr/bin/anonymous : 2011-08-04 08:17 ID:Qeftnp5w

Someone made a GameBoy Color emulator in JavaScript, now you can play all the classics!

10 Name: #!/usr/bin/anonymous : 2012-01-04 09:32 ID:gvG7mhwu



Nice ID :o

11 Name: #!/usr/bin/anonymous : 2012-01-17 19:38 ID:wR2Te6ws

This reminds me of the PC emulator someone wrote in javascript:
It isn't very fast, but it's still very impressive.

12 Post deleted.

13 Post deleted.

14 Post deleted.

15 Post deleted.

16 Post deleted.

17 Post deleted.

18 Post deleted.

19 Post deleted.

Name: Link:
Leave these fields empty (spam trap):
More options...

Preferred Editor(s) (170)

1 Name: #!/usr/bin/anonymous : 2008-05-21 13:03 ID:/y/PlSFi

What's your favorite IDE/text editor when it comes to programming? Also, what's the setup in the banner up top?, that is.

161 Name: Wanda : 2015-05-31 01:53 ID:ZjyGJgk8

Sublime Text, vi on servers, Visual Studio is fine too.

Depends what I'm working on. If i'm working on some bloated e-commerce mess for a .net client, visual studio is opan obvious choice,

Everything else, ST or if unavailable vi

162 Name: #!/usr/bin/anonymous : 2015-06-09 18:58 ID:QjMGRIOO

BSD vi, ed, mg on Unix. Sam and acme on Plan 9. Pe on Haiku.

163 Name: #!/usr/bin/anonymous : 2015-06-14 16:44 ID:MuAco6xD

I like vim with solarized dark colorscheme and the linter syntastic. All is very comfortable that way.

164 Name: #!/usr/bin/anonymous : 2015-06-17 22:27 ID:9e5Wccph

Well, I started with "vi" on my very first shell account (a SunOS 4.x box, back in 1995). No idea what exact version of vi it was, but I didn't have any colors or visual mode, or anything like that. Soon after that, I installed Slackware and started using "vi" there as well. And since I completely stayed away from Windows all these years (except when required for a job), I just kept using vi or vim.

Somewhere along the way I got the crazy idea to swap the Escape and CapsLock keys, using either xmodmap or its console equivalent (e.g. wsconsctl in OpenBSD). That made things a lot more comfortable...

Speaking of OpenBSD, their /usr/bin/vi program is a slightly enhanced version of nvi, because it allows you to split the screen and have several text windows displayed at once. I didn't even realize this until one of the developers mentioned it on openbsd.misc:

our vi has multiple windows.
:E new_file
then ^W to move from file to file.

Post too long. Click to view the whole post or the thread page.

165 Name: #!/usr/bin/anonymous : 2015-06-18 08:30 ID:Heaven

there's no such thing as vi that doesn't have visual mode. perhaps you're thinking of ex?

166 Name: #!/usr/bin/anonymous : 2015-06-18 13:06 ID:9e5Wccph

Sorry I meant no visual block operations (select, copy, paste) like vim has. Yeah, the SunOS vi was running in regular full screen mode.

Now the "mail" or "mailx" programs, those dropped you into ed or maybe ex by default, for some reason. I mostly used Pine those days, and only occasionally mail in command line mode, e.g.:
mail -s "hi there" recipient@host < msg.txt

Later on when I started doing sysadmin work, I found myself just telnet'ing to SMTP and POP3 ports a lot (for testing purposes). Those interfaces are actually pretty simple; there's just no nice command-line editing/history or saving of messages to "sent-mail" folder or whatever (unless you're logging the session via typescript or whatever).

167 Name: #!/usr/bin/anonymous : 2015-06-26 20:32 ID:Qe6gX1aW

Emacs is love; Emacs is life.

168 Post deleted.

169 Post deleted.

170 Post deleted.

Name: Link:
Leave these fields empty (spam trap):
More options...

New thread

Name: Link:
Leave these fields empty (spam trap):
More options...