How to choose a Clojure JSON library [closed] - json

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 6 years ago.
Improve this question
There are multiple JSON parser/writer libraries available for Clojure, including:
clojure/data.json
cheshire
clj-json
What are the pros and cons of each, especially regarding speed, memory footprint, and programming convenience? Are there any other important factors to consider?

I decided to run a little shootout (the link is to results and the code used to test).
In terms of speed, clj-json is the fastest, 1.7x cheshire, and 5.6x clojure.data.json for a simple parse/generate task.
clojure.data.json has the smallest footprint, and clj-json and cheshire follow. cheshire has some superb features, though, and is my preferred library for dealing with JSON. You get support for SMILE, as well as a lovely interface for interpreting JSON (adding types, special rules on keys, etc) and custom encoders (the last also found in clojure.data.json).

Related

Are classes and structures both subsets of "records"? [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'm writing documentation for my AQA A-level Computing project. The project is a game which takes place in a Console application, which heavily depends on a series of classes and structures in a separate class library I have written. I don't know how to title the section in my documentation where I describe these classes and structures, and I'd like to know if there is a word that encompasses both concepts. Does the word "record" include both classes and structures, or is it tied to a specific implementation?
I'm aware that this is more English Language & Usage, but I thought it was more likely to get a response here where there are more programmers.
Yes, you could use the term record as objects/classes/structures are just differing types of records, or records with functions to handle the data in the record.
However, just to encapsulate all your possibilities, you should probably utilize the term Data Structure. I find that data structure is more common parlance than record.

What is "overkill"? [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
Programmers often wonder if the use of a certain library or programming style is overkill. They also often claim that this is the case (and they are often believed).
What does "overkill" mean in the context of programming?
"overkill" is typically used to mean deploying overly flexible and/or over-engineered solutions to solve what is ostensibly a simple and highly localized problem. The canonical example is FizzBuzz Enterprise Edition.
The term "Overkill" literarilly (if there was ever a literal use of it) refers to the action of killing something or someone, with more resources than necessary. Something like shooting a deer 50 times to make sure it dies.
In programming it applies for the same principle: making use of more resources than necessary or to find an overly complex solution to a simple problem.
Some simple examples are
for i=1 to 100
x[i]=2^z[i];
y=x;
end
Where copying the entire array x in every iteration step achieves the desired result but you could also copy it elementwise y[i]=x[i] saving you some 900 operations and is thus an overkill.
Using the OpenCV library to threshold an image is definetley possible but uses many more resources than strictly necessary and is an exagerated example of an overkill.

Does the GameEngine you plan to use need to be written in the same language you are programming the game in? [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
While my common sense says "Yeah. Duh.", I thought I read something somewhere long long ago that referenced the ability to use different programming languages in harmony and wondered if something like that applied here.
IE, if a game engine is written in C++, but the game I'm developing has been written in C#/XNA, can that game engine be utilized for this game?
Usually the language you use to write game engines aims for efficiency and speed. The language you use to write games aims for simplicity and expressiveness. So, it totally makes sense to use a different language for each purpose.
How they will work together is a different story. Usually, the engine's API will be given a convenient interface to be used in the game "scripting" language, so the latter will interact with the engine through successive API calls. The "heavy lifting" will be all done by the engine though...

Disadvantages of First-class functions [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 4 years ago.
Improve this question
Are there any disadvantages to having first class functions in a language?
Joel in this entry says
Object-oriented programming languages aren't completely convinced that
you should be allowed to do anything with functions.
I might be naïve here, but why don’t all languages support first class functions if there aren’t much issues
In an ideal world where there was never a cost associated with developing new features, the only downside I can see to including functional programming techniques would be confusion to developers who are not familiar with functional techniques (and I don't really see that as much of a downside).
In reality, treating functions as first-class typically requires significant rewrites to the compiler itself. The cost of doing this has to be weighed against the long-term gain.
Adding this feature might be a disadvantage if introducing the change requires a costly re-write of language compilers, interpreters, and other tools. It might also be a disadvantage if the language's culture is not familiar enough with the advantages provided by this feature in which case adding the feature is a waste of effort.
Additionally, first class functions require runtime interpretation of code and some form of garbage collection. Both of these add overhead that might not be suitable for certain problems and languages.

Story generation [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 8 years ago.
Improve this question
Upon reading a blog post about a minimalist story-generating python program, I was asking myself - and you - which are the most successful attempts at such programs. I remember seeing something using generating grammars, for instance. And which are the best attempts that, like this one, are extremely compact, either self-contained or able to read, say, the Web or an independent textual corpus (but not simply a file with a large number of story chunks)?
Search for Talespin for some famous ground breaking work. (Example: Micro-Talespin in Common Lisp by Warren Sack.)
I actually like Turner's "Minstrel: A Computer Model of Creativity and Storytelling" better :
ftp://ftp.cs.ucla.edu/tech-report/1992-reports/920057.pdf
Talespin is, in my opinion, blind in it's algorithm to everything but planning. So the author goals are given very little consideration (if at all). Minstrel is better that way.