Subj : Re: I have an Idea
To : Fireball
From : echicken
Date : Mon Feb 11 2013 11:16 pm
Re: Re: I have an Idea
By: Fireball to echicken on Mon Feb 11 2013 17:22:03
Fi> with a little reading and tutorial. I have yet to see a good tutorial on
Fi> JS, and I haven't found a good guide to command line JS operation either.
I guess it depends on how you like to learn. (I rarely go the tutorial route,
myself, finding it tedious.) With JS I stared by modifying existing code until
I began to understand more of what was going on, then slowly began writing my
own stuff from scratch. I do however find it difficult to believe that there
are no good JS tutorials, though perhaps the problem is that most of them are
geared toward web browser-based JS.
Command-line operation (a la Python, Ruby, probably others) as in typing line
by line into an interactive interpreter really isn't a common thing in JS land
(although perhaps node.js offers this,) though there are ways. I guess if
you're used to that sort of immediate feedback it would be difficult to get
used to editing and saving your script, then running it separately.
Fi> I understand where you're coming from. I'm sure JS has it's advantages,
Fi> but then so does Python. Both are mature OOP languages. One was made for
What I was saying was not so much that JS is great in and of itself, but that
we have a rich set of objects available from Synchronet for that language
already, and a lot of extra libraries written. If someone wants to duplicate
all of that for some other language ... well, sure, go for it.
Fi> but then so does Python. Both are mature OOP languages. One was made for
Fi> web environments while the other was made for other uses. I think my
A lot of JS examples you'll find might suggest that it's for web environments,
but that's because they're examples for client-side scripts running in web
browsers. Without the Document object, etc., JS is a language like most
others, with the typical building blocks. What it may lack in a *browser* in
terms of file I/O and sockets, to name two notable things, we do have in JS
under Synchronet (a File class, a Socket class, and more.)
Fi> biggest issue is, even with all the sbbs JS examples I've been over in the
Fi> last few days, I still can't figure out how it works.
This may depend on what code you've been looking at. Most people start by
doing a really bad modification of one of the existing command shells.
Fi> One could conceivably make a python methods available to a program by
Fi> including the Python.h. Alternatively, using python ctypes and
Fi> creating/importing the synchronet definitions as a library could provide a
Fi> lot of useful information for making sbbs python scripts (doors and
Fi> utilities).
Yep, that would take care of most of it. If somebody (you) wants to do that,
more power to them.
Fi> I'm not looking to change completely. I like Synchronet and it's many
Fi> features, just not real thrilled with the learning curve of JS.
Yeah, I wasn't saying "go away and use this Python based BBS instead", just
pointing it out. JS make take a bit of getting used to; it's just my opinion
that we'd all benefit by working with the same libraries and such - but failing
that, working in your own preferred environment is better than nothing.
If you do have specific questions about JS & Synchronet, there are many of us
who read this sub and should be able to tell you what you want to know. If
some specific examples of how to do certain things would help, someone (me, at
least) can provide them, within reason.