Hacker News new | past | comments | ask | show | jobs | submit login
VNC client in 200 lines of JavaScript (mgechev.com)
66 points by mgechev on Aug 31, 2013 | hide | past | favorite | 11 comments



An interesting article, but many posts titled "Create <awesome program> in <small number> LOC" are misleading if they are highly dependent on underlying libraries. The logical end of this style of article would be something like "How to do X in one Character" and make a call to some external package.


You're absolutely right about the underlying libraries, I guess the the title wasn't the most appropriate one. Anyway, if we count V8, node.js standard libraries, webkit,...etc. there's no software written entirely in JavaScript which is less than millions lines of code. The main idea of the article was to show how easy things goes with the tools HTML5 gives us.


I'd say you accomplished your aim. Great little article, and awesome to see the power of the remote frame buffer lib.


I knew this sort of comment would be a highly-rated one - it's just a pointless put-down. The author didn't write a kernel, or the net stack, or libc, or v8, or the node libs, or loads of other bits that are used in the process. 200 loc is a valid, honest and interesting metric in this case which you're reading way too literally.


Yeah, its not really possible to write a vnc library in 200 LOC without standing on the shoulders of giants.

I still think it is useful to explain how to glue different parts together and (hopefully) get people interested in some technology that excels at glue(python etc).


VNC client in one line of shell: `vncviewer target.example.org:1`


Nice work, and thanks for sharing.

BTW I'm not sure why other posters are attacking you for not including 3rd party library LOC counts in your LOC count. That is not standard practice, and you aren't misleading anyone by not counting 3rd party libs. Some people just have to find something to complain about, I guess.


It's not that people have to find something to complain about, it's just accurate. It's ridiculous to say VNC can be implemented in 200 lines of JavaScript. Of 200 lines of any language. If the third party library does low level stuff like collections, or http or whatever then they usually don't get counted, but if the majority of the functionality is in a library then it's disingenuous to not include them.


Create a new language, VNCscript, which has a single keyword, 'start'. Implement a VNC client in a single line of code :)


Exactly. To all the posters who are making that comment, think of these "How to implement X in Y lines of code articles" as a brief introduction to the architecture of some important standardized type of software. These are like the "How things work" TV shows on TLC and the Discovery Channel, but hands on.


This is nice ; is there a way to extend this to be a Javascript based Webex like library. I would pay for that . I often have to walk my users through a DHTML screen when I am on the phone with them and without being able to see what they are seeing, support task becomes a challenge. I would gladly pay for such a library.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: