Tutorial or Book on implementing a metalanguage in Javascript [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I've been working in Javascript and PHP but I find that the hardest part isn't the implementation but the design of the webapp architecture [as usual . . .] In that direction, I wanted to create a sort of meta-language that takes PHP code as input but outputs JavaScript code thus making the design and implementation phase less painful [s.t. similar to GWT, Google Web Toolkit]. I found writing the this interpreter from scratch [parser, lexer, . . .] a viable option but an long one. Then I came across Processing.js [a library created by John Resig] where the user actually write java-like code that is transformed in Javascript by Processing.js then evaluated. I've searched the web for tutorials that introduces this powerful Javascript capability but didn't find even one! Can anyone PLEASE help me with any link, book title where I can get a least an intorduction? Thanx for your response!!!!

I would say your best deal would be to go with Haxe.
Haxe is a language that is designed to target (be exported) into the following platforms:
JavaScript
Flash
PHP
C++
Making it a very powerfull resource when creating web Apps as you can write in Haxe and have all your code ported to JavaScript, Flash, PHP or C++ without hassle.

Honestly, I think processing.js is not suitable for what you want, it was made to deal with the new canvas element, not the webpage.
Also, I think (honestly) think it sucks. They parse processing using Regex, it is totally wrong, you can't parse a programming language using Regex.
There is a javascript compiler compiler, called JS/CC, it is very easy to use, just learn the grammar and you can make a simple programming language.
But if you wanna make a complicated language (like processing, or php) by yourself, get ready for the nightmares.
PS: You'll need to know Javascript to implement a programming language in Javascript...

How about creating some PHP-functions that generate JavaScript-code? I do not think that you really need to write an interpreter for a custom script language. Ruby on Rails used to generate some JavaScript with simple Ruby-code, for example.

Related

Javascript built-in documentation/help functionality [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
When writing code in Java, the nice thing is that the IDE provides code-completion and auto suggestions mainly because Java is strongly typed language and therefore static type analysis can be achieved. When writing code with any library, or even with the standard JDK for that matter, I can easily reason about APIs (return types, and input parameters, etc.) for any given method of a class. If I need further understanding, I read up on standard JDK documentation or documentation for that given library.
With python, since the language is dynamically typed, type inference happens at runtime, for me, it's often a bit trickier to reason about APIs because there is no compile time checking. However, I can still be as productive because python offers built-in things such as the "dir" command which tells me everything about a particular object (methods, magic methods, fields, etc.) and also the built-in "help" command provides documentation at the command line for any type/class/module.
Does Javascript provide anything similar to python in that regard? I'd like to be more productive when coding in Javascript, but tabbing back and forth betweeen documentation and writing code has slowed me down a bit. Is there a better suggested approach?
Sublime text has a plugin called docblockr that works quite well. However, many IDE's (eclipse/intellij/sublime text are my favorite three) support this feature.
Languages and IDEs are two different things. A language can be supported by multiple IDEs, and it is possible for an IDE to support multiple languages. So, there is no such thing as "the Java IDE" -- there are many IDEs that support Java. The same applies to Javascript.
What you need to do is just search for an IDE (and/or plug-in for that IDE) that supports the features that you would like for your chosen language.
I happen to be partial to the eclipse IDE, which supports many, many different languages, including Javascript. Here is a link that might be helpful. But there are many other choices out there. The choice is up to you.

Which environment use for writing HTML code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm intermediate java programer. I have good knowledge on java fundamentals and programming in general. So i don't have problems get used to different IDEs and start with new languages. I want tu dive deeper in java front end development. I have HTML basics so i know that you should(can) start writing HTML+CSS+JS in ordinary windows notepad. But i did it that way some time ago so first i need to refresh my knowledge and after that gain new information.
So my question is is it still valid approach to use notepad or should i immediately start coding in some more specialized software such as Dreamweaver
I never would code in notepad. You have no file-encoding and no syntax-highlighting. You cant see simple mistakes.
A good start for every language is Notepad++ when you are on windows. At Linux I use Geany.
When it comes to bigger application with php I recommend phpStorm
For just a simple and small project or refreshing your skills, notepad++ is absolutely okay. To do a little bit more I would use PhpStorm from JetBrains, which got excellent support for HTML, JS, CSS, PHP and also some JS-Frameworks such as JQuery.
I use Eclipse IDE with plugins for each programming language, for example, PDT for PHP.
I recommend both for small projects, and for larger applications.
It is free.
I would not recommend using notepad. It does not depend on your ckills in koding, notepad just won't let you see all the syntax as it should be seen and it will be much harder to write a code. Taking in consideration how long HTML codes are.
I would personally recomend using Sublime Text 2, i've been using it since the begining. It is perfect both for beginners and experienced users featuring lots and lots of settings. It understands almost any traditional language. And it's also free :)

Should I use Lua? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am going to work on my new project where client has demanded to use 'Lua' if possible, I have never used it before and by searching on it I found it is fast compare to javascript and getting popular nowadays.
As I am very confused I had never use it before so I want to know something
Is it really better(in terms of performance and use) then javascript?
Will I get enough resources(because I don't want to move over after starting development due to lack of resources or it becomes hard to me develop)?
Will it needed anything other than C compiler to run?
Please guys it is really important to know about such thing before starting. Any help will be appreciated.
I'm assuming you're writing a standalone application in C or C++, and you're looking for a language to enable people to extend that application by embedding another language. That's pretty much Lua's territory.
Lua's strong point is that it's very easy to embed in your (C) application. It compiles quickly, it's tiny, licensing is liberal and using C functions from Lua is relatively easy. Standard Lua has enough performance for most things you'd use a language like this for; if you need more raw speed you could look into LuaJIT, the JIT-compiler for Lua.
As for your questions:
LuaJIT will probably be pretty much as fast as you can get for a dynamic language. Lua is used in games (Sim City, Far Cry, World of Warcraft), where performance is very important.
If by 'resources' you mean documentation: sure. Lua is a very simple language, much simpler than JavaScript; the manual should help you get started with the language itself, the wiki is tasty for tips about the embedding process. This article has an example you can copy/paste.
Lua pretty much runs everywhere a C program will run. It doesn't even need an operating system, and it doesn't depend on anything at runtime if you bundle it correctly.
Embedding a full JavaScript environment in your application, and interfacing your application to the JS environment, can be a lot of work (even though Google's V8 engine has some functionality to help you; see here).

Is there a prebuilt website with logins I can work from? (Just starting to use javascript) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to build a website that allows users to upload files and a few other actions. I have zero experience with javascript so I was wondering if there was some type of built site that already had logins coded so I could just work on the other logic?
I'm a long time delphi developer so I'm not new to programming. Any javascript video references would be great as well.
Thanks in advance.
You don't want to be handling logins with plain-old JavaScript unless you start building a super cool NodeJS setup, which, I wouldn't recommend if you have zero experience with JavaScript.
To ease your JS adventure, check out JQuery.com which makes it easier to code JS without worrying so much about browser quirks.
For easy server-side login, I recommend PHP since there are literally millions of tutorials and free code snippets out there, hosting is cheap, and an enormous community of PHP developers online to help you. To ease your PHP adventure, start with a framework such as CodeIgniter.
To answer your question, here's an example of a PHP + JavaScript (JQuery) login solution: http://blog.webwizo.com/2011/05/04/simple-login-with-php-and-jquery-ajax/
In order to upload files, you'll need a server-sided script, possibly done in PHP.
As for communicating with the server, it can be somewhat daunting for a beginner, but it's largely done via xmlhttprequest (otherwise known as AJAX).
Here's a tutorial on how to use it by W3CSchools, but there are plenty more on the net: http://www.w3schools.com/ajax/default.asp
One word of advice; don't make the mistake of relying of a JS library too soon; familiarize yourself with the language and its capabilities. A lot of answerers are just going to say "Use JQuery." You can (and possibly should), but it's important to know how Javascript works without it.

Any good javascript BBCode parser? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Currently i'm parsing bbcode server side but i'd like to show a preview just like this site does.
If I process the bbcode serverside using ajax it's a bit laggy, so i thought doing it client side, to just show the preview.
Do you guys know any bbcode parser written in javascript?
It is a bit late, and the question has certainly been answered. However if you are still open to suggestions, and have not yet spent your time converting the indicated parser from C# to JavaScript, I have written a parser (originally in PHP) which I converted myself[2] to JavaScript. It is available at bitbucket under the 3-clause BSD license. The parser seems to be reasonably fast, but I haven't performed any analysis on its speed.
It may not be as flexible in some ways as other possible projects out there, but it does allow defining your own codes ("bb-code" or not, with quite a few properties), and is also all contained within the one file. This is not a simple find-and-replace parser, and is not based on regex.
If this is of any interest to you, it might save you from having to convert that other library. Technically, I'm a relative "unknown", but that's the great things about JS/OSS: you can check out the source to see what I've done.
[2] As a result, there are a few remaining "compatibility functions", but I rewrote things which had native equivalents available.
I haven't personally used any Javascript BBcode parsers, but the top two Google results (bbcodejs and this blog post) seem pretty weak. The former only seems to support simple find-and-replace, and the latter seems to have pre-set BBcode built in, so you'd probably have to hack it a bit if you chose that solution.
Your best options are probably to roll your own solution (possibly basing your work off one of the two links here), or just use AJAX and move on. That's probably the best way to ensure that previews are accurate, and previewing doesn't have to be real-time on every keypress, anyway; a delay before even sending the request is acceptable.
I encountered the same problem, so I wrote my own. That supports BBCode -> AST Array -> any kind of markup, now supports HTML and React. And has plugins and presets support
https://github.com/JiLiZART/bbob

Categories

Resources