Lisp with reader macros that targets the browser? [closed] - clojure

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Clojure/ClojureScript does not have reader macros. I personaly think it is a huge loss as I'm specifially interested in hacking with the syntax. Is there way to develop websites using a lisp with reader macros?

Common Lisp has Parenscript, that allows you to generate JavaScript from Lisp syntax, and be able to use reader macros.
You can also hook it with slime-proxy and swank-js to have a fully interactive experience.

You might be interested in sweet.js. It's essentially JavaScript with a powerful macro system that does much, if not all, of what reader macros can do. Now, it's not actually a Lisp, but JavaScript was partially inspired by Scheme, and sweet.js's macro system is intended to be the natural extension of the Scheme macro system to a language with non-S-expression-based syntax.
The big caveat is that sweet.js is super-new. It doesn't even have version numbers yet. So it's more something to keep an eye on than something to use for production code just yet.

Related

How to make a simple embeddable scripting language for C++? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I'm building a game engine and can't quite find a scripting language that does what I want, and is embeddable into C++. Therefor, the natural solution is to build my own.
I know the basics about Flex, Bison, peg/leg, and a little about VMs. Can I use this knowledge to build a small scripting language for a game engine? How would I implement an embedded language? I'm not really sure where to start off building such a small language.
A common scripting language for use with C++ is Lua. You can implement it with Luabind or another binding, there are plenty (and there are even tutorials to write your own).
Another option is to use Python with Boost.

How to read and write "Excel" with c/c++ (in smartphone app develop) [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm a smartphone app developer.
I want to make a app running in iOS,android,winphone.
I use cocos2d-x platform tool to make this app. it base of c/c++ language.
So,
Dose anyone can tell me How to read and write excel with c/c++
For what purpose? Just reading the file can be done by treating it as an opaque stream of bytes, just like any other file.
I doubt that's what you really mean, though.
If you want to interpret the file's contents, and present/update the calculations, then surely you must realize that the answer to "how" that is done must be gigantic? Excel is a huge, huge, and very old application, probably the result of many millions of lines of code.
Nobody can tell you "how" to interpret that in a simple answer here.
The closest thing you can probably get here is a recommendation on a library to use. I had a quick look, and LibXL was the first one I found for C++. It is a commercial library, and I have no experience with it.

What is Bison and why is it useful? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have been programming for a few years now and have seen the name Bison in passing, but never bothered to ask why it is or why it might be needed. How can Bison effect how I program, can it make my C/C++ code faster?
Bison is a parser generator. It takes it's input in something similar to Backus-Naur notation and outputs code to parse input according to that grammar. It lets you write a parser more easily than you would otherwise. Instead of having to do everything manually, you only have to specify the rules of your grammar and what you want to happen when it matches one of the rules.
GNU Bison is the only Bison related to programming I know of. It won't make your code faster, and it's possible that you won't ever need it in your life. However, learning some compiler theory, or even writing a simple compiler yourself, is a terrific learning experience that does affect the way you program, the way you think about computer programming, and a lot of things like that. If you enjoy formal languages and automata, you'll enjoy compiler theory; if you dislike theory in general, it's probably not for you. If you're interested, there are lots of questions about starting books on Stackoverflow.
Oh and, once in a while a programmer does need some more complicated parsing work and suchlike, and it's a huge boon to know about parser generators, instead of writing everything by hand, following a naive approach.

Parsing HTTP request streams with C++: any not state machine way with same speed or better? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
So we have some simple request/response parsers. thay are bacically simple state machines that could be esely created in pure C code. I wonder what is C++ way to parse HTTP 1.0+ requesrt/response streams that would be as fast or faster than C analogs yet would be sweeter from code prespective?
Rather than coding up explicit state machines, you could probably use Spirit.Qi to build a parser for the data. This generally gives rather slow compilation, but execution that's quite competitive.
You might want to look at a previous answer by #sehe for some inspiration on parsing binary data with Spirit.

How to encrypt a text [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I need to implement a simple text encryption in C++ without using any existing framworks. This is purely for educational purpose to learn the in-and-outs and to learn the way to implement such a system. I am not planning to implement this in production code. I can use Windows APIs but it won't be cross platform. I am trying to learn something can work across multiple platforms. the best way to implement this is implement using C/C++. Please share good resources or links in this regard.
Depending on what you actually want, you could look at the CipherSaber project: instructions to implement your own RC4 encryption code for a simple IV+text format.
However this is an academic exercise only: you should never use your own crypto code in production unless you really know what you're doing. You could also read Schneier's Applied Cryptography for a good introduction to all of this stuff.