HNHacker News
TopNewBestAskShowJobs

srpeck

753 karma · joined May 28, 2014

[username] at gmail
submissionscomments
srpeck··on Fast Network Server Programming
Code: https://github.com/geocar/dash

"really fast webserver for kdb and dashboard-making bits (more than 10x nodejs)"

srpeck··on Minimum Viable Language
Have a look at k5's full language spec: http://kparc.com/k.txt
srpeck··on 1% the Code (2001)
From reading k/q code (or even C code written like the J Incunabulum http://www.jsoftware.com/jwiki/Essays/Incunabulum), I generally find that it may take me 10x as long to fully understand it due to density and my lack of proficiency, but that still makes me an order of magnitude more efficient than reading (and scrolling!) through the 100x longer mainstream code, often spread out over multiple files and directories. Better yet, referring back to a piece of code I have already read is even faster - I am not hunting or scrolling for anything.

I recently experimented with writing a web application in q while limiting myself to a single screenful of code - the efficiency is amazing! I am still trying to figure out what factors contribute, but it reminds of solving math problems. Write down what you know and stare at it - no distractions.

srpeck··on Vector Processing Languages: The Future of Analytics and Real-Time BI (2010)
About halfway through: "Being able to interface these fabric-scaled vector processors with rich visualizations of the sort one encounters in R, Excel, MATLAB, Tableau, and other real-time data graphing exploration vendors makes for a great marriage of equals."
srpeck··on An introduction to Kerf
q is a language written in k - when in the q interpreter, you can drop into k by typing a single '\', and then return to q using the same method.
srpeck··on An introduction to Kerf
32-bit version of q/k4/kdb+: http://kx.com/software-download.php

This version is technically unrestricted, but cannot be used for commercial purposes.

srpeck··on An introduction to Kerf
Market segmentation, premium pricing, signalling, etc. Basically, when your product is good, you can charge more for it. Free is a great price to get exposure, but unnecessary for extraordinary profitability (see Kx).
srpeck··on An introduction to Kerf
Great description from the reference manual (https://github.com/kevinlawler/kerf/blob/master/manual/refma...):

"Kerf is a programming language built on pragmatism, borrowing ideas from many popular tools. The syntax of Kerf will be familiar enough to anyone who has programmed in C, Python or VBA. Data is described using syntax from JSON (JavaScript Object Notation), a text-based data interchange format. Queries to search, sort and aggregate data can be performed using SQL syntax. Kerf’s built-in commands have aliases which allow programmers to use names and terms they are already used to."

srpeck··on Great Australian Software Developers: Nick Gammon and G-Pascal
Love it.

"The Commodore 64 version had extra features to support the hardware on that PC. In particular, I added stuff to let you handle sprites, the colour screen, and the sound chip. This extra stuff took about another 4 Kb, so I think the whole G-Pascal took up 16 Kb."

kOS is my hope for a smaller and more efficient future: http://kparc.com/o.htm

srpeck··on Ask HN: Good programmable robot kit for teens?
Playing with Mindstorms+NQC (http://bricxcc.sourceforge.net/nqc/) is one of the main reasons I love programming. I am sure there is an updated version for the latest evolution.

I later got into Handyboard+IC, which is even more powerful/hackable.

srpeck··on W – A simple programming language
See also k (http://kparc.com/k.txt) for keywordlessness, though a few keywords are added for kdb database functions.

Excerpt:

    20 primitives/verbs, 6 operators/adverbs and 3 system functions.
    1 control structure($) - rarely used - and no reserved words.
srpeck··on Show HN: Caret – Better Markdown Editor for the Desktop
GitHub Flavored Markdown editor with PDF export: https://github.com/srpeck/markdowned

The editor happens to fit in an HTML file <9k (excluding the behemoth browser...:).

srpeck··on K&R C (2014)
These came to mind:

http://kx.com/q/c/c/k.h

http://kx.com/q/c/c/c.c

http://www.jsoftware.com/jwiki/Essays/Incunabulum

srpeck··on Introduction to J Programming Language (2004)
I find k to be far more consistent and simple to understand. k5 language spec: http://kparc.com/k.txt
srpeck··on Sbase – Suckless unix tools
Same on kOS. In case you had not seen them, early kOS screenshots: http://www.reddit.com/r/apljk/comments/1vcioz/arthur_whitney...

Featured live in geocar's presentation: https://www.youtube.com/watch?v=kTrOg19gzP4&list=PLmRrx948XM...

Also: - "Arthur wrote an SQL in 20 lines of K, and a dynamic window manager in around 60 of C...kOS's kernel is under 60 lines of C as well (including annotations; paging, filesystem, syscalls, etc)." (https://news.ycombinator.com/item?id=9002302)

- "k includes language, files, procs, ipc, webserver, dbms, ..z includes graphics...edit.k is 1KB code + k/ztk(9KB)." (http://kparc.com/o.htm)

- "kOS doesn't use the Linux kernel code. It supports a few of the same syscalls: clone, execve(!), epoll_create, epoll_ctl, epoll_wait, dup2, stat, rename, unlink, getcwd, chdir, fstat, getdents, open, close, read, write, ftruncate, mmap2, munmap, ioctl, gettimeofday, socket, bind, connect, listen, acccept, socketpair, setsockopt...execve just runs another k interpreter (regardless of what you tell it to do) though, so it can just be used to run more k programs." (https://news.ycombinator.com/item?id=8744769)

srpeck··on Vocabulary based programming
Many functions in k (see http://kparc.com/k.txt, also in the APL family), are shorter than the 'readable' name that would be attached to it in another language. Rather than deciphering a long name and then reading the code, why not just read the code and find out what is really happening?

Also interesting to note is that k's grammar is defined in terms of nouns, verbs, and adverbs.

srpeck··on Show HN: Kxl – Experimental spreadsheet UI for kdb+/k4/q
RodgerTheGreat/JohnEarnest updated his k5 REPL to include the 'explain' option by prefixing \x - check it out! Literally step by step execution of k expressions.

http://www.reddit.com/r/apljk/comments/2y2bic/kxl_experiment...

http://johnearnest.github.io/ok/index.html

  Welcome to oK v0.1
  (inspired by K5)
    \x 1+/1+1 2 3
  1 + 1 2 3 --> 2 3 4
  1 + 2 --> 3
  3 + 3 --> 6
  6 + 4 --> 10
  1 +/ 2 3 4 --> 10
  10
srpeck··on Sylph: the programming language I want
APL, J (http://www.jsoftware.com/), k (http://kparc.com/k.txt).

www.reddit.com/r/apljk/

srpeck··on Show HN: Persistent Group Chat in kdb+/k/q
Thanks for the feedback; I pushed your cleaned up version to Github (https://github.com/srpeck/kchat/commit/5669fcca67fa609a9128b...).

As for your comment in #5, I noticed that I can hot load new versions of the server and client without impacting the existing clients' web socket connections. A production change to chat.htm only requires me to \l chat.k; any existing connections still have the older client running without interruption until they refresh, but all new connections get the new client. However, I am not all that concerned about hot loading new versions, as this is only deployed for a small team on the intranet.

srpeck··on Show HN: Persistent Group Chat in kdb+/k/q
Have a look at Arthur's text editor in k5: http://kparc.com/edit.k

And of course the impending kOS operating system: http://kparc.com/ with HN discussion: https://news.ycombinator.com/item?id=8475809

There are also some good links here, though you may have to dig: http://www.reddit.com/r/apljk/

srpeck··on Show HN: Persistent Group Chat in kdb+/k/q
This might help you understand it: http://code.kx.com/wiki/Cookbook/InterfacingWithC

Once you understand the underlying data structure, a lot of k's design decisions make sense. I am using the k.h file from k4 as almost the sole guide to recreating a toy k5 (http://kparc.com/k.txt) interpreter in C.

srpeck··on Show HN: Persistent Group Chat in kdb+/k/q
Is q more readable to you?

  file:hopen`:index.txt                       / Open message log append-only
  history:("\n"sv read0`:index.txt),"\n"      / Load message history from log
  .z.po:{neg[.z.w]history}                    / On join, send full message history
  .z.ws:{s:(" "sv(string"du"$.z.Z))," ",x;    / On message, add server timestamp
         {neg[x]y}\:[key .z.W;s];             / Fan out to other connections
         history::(history,s,"\n");           / Update message history in memory
         (neg file)s}                         / Append to message log file
  .z.ph:{"\n"sv read0`:chat.htm}              / Serve static client app
srpeck··on Show HN: Persistent Group Chat in kdb+/k/q
Thanks, added.
srpeck··on OK: An implementation of the K5 programming language
Some interesting things often get posted to http://www.reddit.com/r/apljk/ from time to time. For example, old posts from geocar contain screenshots of the kOS desktop.
srpeck··on The Rewards of Creating a Programming Language
It is certainly a fun puzzle; hopefully kOS is released soon to application developers.

Since you are playing in JS, you might also have a look at c.js (http://kx.com/q/c/c.js), which is the tool KX uses to translate between JS objects and k objects through web socket IPC with a k process (http://code.kx.com/wiki/Cookbook/Websocket). Might be useful to see how Arthur envisioned the k data structure in JS. Also, it would be kind of interesting to have a k5 process running in the browser talking with a k4 process running locally in the 32bit trial...

srpeck··on The Rewards of Creating a Programming Language
Awesome. I started building a toy C interpreter to the k5 spec (http://kparc.com/k.txt) based on the k4 data structures (http://kx.com/q/c/c/k.h) and documentation (http://code.kx.com/wiki/Cookbook/InterfacingWithC). That k2 manual is a good find.
srpeck··on From Node.js to Go
You might enjoy Lua (http://www.lua.org/) or k (http://kparc.com/k.txt).
srpeck··on Introducing Socket.io 1.0
I looked for a library for a similar WebRTC project. All of the libraries I found contained superfluous functionality, as I was only interested in data channels and did not want to be locked in by a particular third party. I ended up rolling my own; the WebRTC API is simple enough [1] and there is some example code from Google that points the right direction [2]. Additionally, Socket.io makes for a convenient signalling server prototype, though it is overkill.

[1] http://dev.w3.org/2011/webrtc/editor/webrtc.html

[2] https://bitbucket.org/webrtc/codelab

← PreviousPage 2 of 2