What are you working on? - Programming On Unix
z3bra
(16-06-2015, 11:31 AM)greduan Wrote: Anyway it's hell, you guys in C have it easy. lol

Actually, it's fairly complicated, as the "open()" system call only has 3 modes: read, write, append.
read doesn't matter in this case, but the "write" mode will wipe the original file entirely, so you can write your text in it. so basically, removing an \n at the end of the file means rewriting the file entirely. No matter what. As for append mode, it keeps the original file intact, and you can only add bytes at the end, so not pretty useful for modifyin the initial content :P
vypr
I've been getting irc-osric cleaned up. I completely rewrote the character system, and it's near completion entirely.
Code:
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
G d s+:++ a--- C++ UB P+ L+ !E !W+++ !N !o K--? w++ !O M++ !V PS+++ PE-- Y++ PGP+ !t !5 !X !R tv b+ DI D++ G e- h r y--
------END GEEK CODE BLOCK------

buddhist ~ esperantisto ~ communist
strang3quark
I just did my blog.
I'm also working on simpleRSS, is a Python+curses RSS reader, it still lacks color support but it's ready to use.

http://github.com/strang3quark
greduan
I've been working on a text editor[1]. The FS stuff is proving to be a huge pain in the ass. Mostly the applyChangesToFile.js[2] functionality. BTW it is a text editor in pure Node.js.

[1]: https://github.com/noedit
[2]: https://github.com/greduan/applyChangesToFile.js

What I've learnt is that writing a text editor will teach you HUGE amounts of stuff about whichever language you make it in. So text editors are an interesting project in any language.
Eduan / greduan
https://greduan.com
me@greduan.com
nounoursheureux
greduan: have you heard of [Atom](https://atom.io) ? It is also Node.js editor, but it relies on [Electron](https://electron.atom.io) for the desktop stuff. You might be interested in how they solve their problems :P
Webtm
(06-07-2015, 12:05 PM)greduan Wrote: I've been working on a text editor[1]. The FS stuff is proving to be a huge pain in the ass. Mostly the applyChangesToFile.js[2] functionality. BTW it is a text editor in pure Node.js.

[1]: https://github.com/noedit
[2]: https://github.com/greduan/applyChangesToFile.js

What I've learnt is that writing a text editor will teach you HUGE amounts of stuff about whichever language you make it in. So text editors are an interesting project in any language.
How fast is development with node.js? A friend and I are trying to pick a language neither of us know at all for a project and node.js is one of the options.
greduan
(06-07-2015, 03:26 PM)nounoursheureux Wrote: greduan: have you heard of [Atom](https://atom.io) ? It is also Node.js editor, but it relies on [Electron](https://electron.atom.io) for the desktop stuff. You might be interested in how they solve their problems :P

Yes. And I have looked at some of their code. My text editor is in the CLI, while theirs is pure GUI, so the UI stuff will not match up, sadly.

Otherwise, IMO their code is way too complex. I looked at their `text-buffer` package, that's thousands of lines for a buffer implementation.

Their FS code is sloppy from what I could tell, they just `fs.writeSync`, and store the whole file in memory, which is not good for >50MB files IIRC. This may have changed recently cause I remember them mentioning larger files are supported now.

Right now I'm stuck with the FS stuff, in this case applyChangesToFile.js[1]. I'm coding up a way to apply changes to a file without having to store the whole file in memory to know what the changes are. So you just tell it "this is the file I want you to change, these are the changes" and so it reads the whole file and writes it while applying the changes. Using streams or something in order to make sure that crap doesn't overload.

[1]: https://github.com/greduan/applyChangesToFile.js

(06-07-2015, 08:40 PM)Webtm Wrote: How fast is development with node.js? A friend and I are trying to pick a language neither of us know at all for a project and node.js is one of the options.

The hardest part for a new person to Node.js will be learning JS. JS is not a hard language, but it allows you to do incredibly dumb and stupid stuff (like re-define `true` and `false`, lol), and I'd say like 90% (perhaps less) of people that code in JS don't actually understand JS, so their code is not optimal.

So yeah, it's a great language but you gotta know how to use it, in other words understand the language. In terms of speed, I mean it's as quick as other languages? I dunno what to tell you.
Eduan / greduan
https://greduan.com
me@greduan.com
xero
(06-07-2015, 08:40 PM)Webtm Wrote: How fast is development with node.js?

it's a runtime lang, so it's very fast for development. you save it and run it.

(07-07-2015, 12:06 PM)greduan Wrote: The hardest part for a new person to Node.js will be learning JS. JS is not a hard language, but it allows you to do incredibly dumb and stupid stuff...

^ so much this.
here's a great site overviewing some of js's more "quirky" aspects: http://bonsaiden.github.io/JavaScript-Garden/
TheShadowFog
a forth-like language in ruby
ashen
(17-06-2015, 09:45 AM)vypr Wrote: I've been getting irc-osric cleaned up. I completely rewrote the character system, and it's near completion entirely.

I'd never actually heard of OSRIC before. I need to look into that.




Members  |  Stats  |  Night Mode