Please recommend good reading about Squirrel [closed] - scripting-language

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 9 years ago.
Improve this question
Please, share your favorite links on this language where one can learn the best of it.
And also, please describe in few words the most important features of this language differing it form others languages like Lua.
I just cannot understand why to reinvent another Lua/Python/etc. Maybe I just missed something...
But I like the idea of performance+scripting, so I have to understand it!

The best (and almost only) resource about the Squirrel language is it's official web site and forums: http://squirrel-lang.org
Compare to other well developed languages, Squirrel is still in it's early stage with a very small community, but it is very promising in certain ways among other modern scripting languages:
Inspired from Lua, with the usual concepts of tables, Lua stack etc, but with a MUCH cleaner syntax and C API.
Reference counting with supplementary garbage collector. The design of the run-time encourage the user to remove cyclic reference rather than totally rely on garbage collection (which can be slow or non-deterministic). The user can even re-compile the run-time with garbage collector disabled.
It's a language with C/C++ like syntax. It's kind of taste but it's the main reason of why I will favour Squirrel over Lua.
Build-in support of class, where in Lua you need to do some magic to simulate it.
Supporting C# like attribute, therefore you can supply meta-data to your class and properties. I use this feature to expose my script objects to .net property grid.
Undefined variables result in exceptions instead of silently creating a new null value like Lua.
Other features like lambda function, generator and co-routines are all built-in in this little but powerful scripting language which just made from ~6000 line of C++ code.
To conclude, the Squirrel language is suitable for interfacing with low level modules in a performance critical application (ie. a game engine), it absolutely can serve as a better Lua. Where as language like python is more towards a general purpose, day to day handy problem solving language.

emo framework, a free, open source game development framework for iOS and Android, is based on Squirrel. Its source code contains a few example programs/demos, as well as some library code written in Squirrel. Reading the source of them can be educational, I reckon.
I sincerely recommend having a look at emo for anybody wishing to learn the Squirrel language while having fun developing games or other apps for iOS and Android.

Related

Apache Openoffice Calc Programming

I am a novice to programming using VBA with Microsoft. My organization has now adopted Apache Openoffice Suite as their productivity software.
I have researched several websites seeking information for programming in Oo but am overwhelmed if not confused with the programming language options.
What is the preferred language and where can I find a beginners guide to programming for Oo?
My goal is to develop user forms for a Calc application.
Your question is off-topic for this site:
Questions asking us to recommend or find a book, tool, software
library, tutorial or other 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.
However, I sympathize since I felt that way when first getting started. So let me give an overview of the three main language options:
OpenOffice Basic: This is the best choice for small simple macros, and code can be written using the IDE that is built into LibreOffice / Apache OpenOffice. Many larger projects use Basic as well. Good documentation is available for this language. Note that this is very different from VBA, so your experience with the Microsoft suite will not really help here.
Java: This is the most powerful, and allows the closest integration with the UNO API. However it can be cumbersome, because each UNO call typically requires a queryInterface call. Also it must be compiled, so care must be taken to match version and platform correctly.
Python: I find this to be a happy medium between the other two options. The language provides more structure than Basic but it avoids the extra requirements of Java. However documentation is somewhat limited, and often requires learning from Basic or Java examples.
For any of these three, user forms can be created within OpenOffice using the dialog editor.
See also https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Writing_Macros.

Active Directory User Management with F# [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 have been looking into F# for quite a while now in between projects at work, but never really had the guts to start using it in any of them. Usually just fall back to C# when working with .net.
I am currently planning an automated user management application, basically CRUD between a database and Active Directory. I am at a point where I am willing to use F# as I believe that data handling would work much better and I won't have much of a GUI, only a logging interface in the background.
My question is at this point if anyone with prior knowledge to F# would advise me to go full throttle with this language for a project like this. I am not asking if it is better or not to use the language itself, but if it is advisable as is, or better to just plug in some scripts here and there. Or if F# is a no go for a project like this especially for someone who had a term of Scala and only wrote some math functions in different ways possible in F#. This project has a dead line, too.
Just afraid that if I don't start using the language in a real project soon that i never will.
In fact, my first production (in professional capacity) F# code bits involved querying Active Directory and stuffing the results into a SQL Server database. It worked out very nicely, so I say go for it!
Some pleasant points I remember:
I created some F# record types to project raw ldap results into... pattern matching on the record types was a boon.
I implemented an implementation of the dynamic operator ? for accessing the properties of the ldap results in a less stringy way.
I used SQL Server's bulk copy ADO.NET feature for efficient large inserts of ldap into the database. F# allowed me to create clean, easy abstractions that hid some of the ugliness of the raw ADO.NET API.
I implemented these backend F# bits in a standalone project which was consumed by a C#-based APS.NET MVC project (mostly to push a button to execute some action). Interop with C# was pretty nice (I did have to expose a more C# friendly API, if I recall, but it was simple and easy).
F# interops with .NET APIs like a champ, so no issues there with the ldap API
F# is fun and reduces defect density!
I myself, would definitely give it a try, as the code seems to be very maintainable even by people who do not have deep knowledge of F#.
My opinion might be slightly biased, though, as I very much like F# myself. But I did have the opportunity to introduce F# at work to my team of C# developers, who had had no F# knowledge at all.
We started off with a few coding dojos, where after a quick language intro, the team managed to write more unit tests and complete more of the coding kata, than ever before in C#, even though they are new to F#. And this consistently over the last four coding dojos now.
Also we rewrote our build scripts in F# - we had used powershell scripts before. And this encouraged us to go way beyond the complexity of the old build scripts. And it is a fact, that the team now feels like the code is very maintainable, even though they have a limited knowledge.
Actually, it has been such a successful endeavour, that we are now putting real thought into writing some imporant core components in F#.

Recommended IoC framework for iOS? [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 9 years ago.
Improve this question
Can anyone recommend a good IoC framework for iOS to facilitate dependency injection?
The only one I've found so far is Objection Framework which apparently is similar to Guice (which unfortunately is unfamiliar to me). Is this one a common choice for iOS and are there competing frameworks that are worth checking out?
Typhoon
The Typhoon-website lists the key features. A quick summary:
Non-invasive. No macros or XML required. Configuration is done using an Objective-C or Swift API that takes advantage of the Objective-C runtime.
Lightweight. Just 2500 lines of code. It has a very low footprint, so is appropriate for CPU and memory constrained devices. Tuned for performance.
Makes it easy to have multiple configurations of the same base-class or protocol.
No magic strings - supports IDE refactoring, code-completion and compile-time checking.
Supports injection of view controllers and storyboard integration.
Supports both initializer and property injection, plus life-cycle management.
Powerful memory management features. Provides pre-configured objects, without the memory overhead of singletons.
Excellent support for circular dependencies.
Battle-tested - used in all kinds of Appstore-featured apps.
An internationally distributed core team (we even monitor StackOverflow), so support for any of your questions are never far away :)
API Docs and sample app
API docs: http://www.typhoonframework.org/docs/latest/api/
We have some nice sample apps, including an Objective-C example and a Swift example.
...are there competing frameworks that are worth checking out?
Objection is the DI library I could find on google for iOS, so you might be stuck with it if you want a pre-built library.
DI doesn't specifically require a framework to use. If your app is small, you can simply create all your instances at the application root and inject by hand.
If you need more than this, and the existing frameworks aren't cutting it for you, you could roll your own Service Locator, then build a DI container on top of it.
You could also port an existing smaller framework from another platform. There are several "small" ones on .Net, for example - Ninject and SimpleInjector.
Is this one a common choice for iOS...?
It seems that it is a fairly small project as there is only one author/contributor listed. There aren't many issues filed. The iOS market is fairly large though. So I'm thinking that only a very small portion of all iOS developers use this library.
But this isn't necessarily a bad thing. It seems to be created, used, and supported by a small company. It has had fairly steady updates for the past year.
My anecdotal experience with similarly scoped open source projects: I don't always get new features super-often, and I'm often the one who ends up finding bugs. But I tend to get support on the existing feature set very quickly, and a lot of attention is paid to support e-mails I've sent. YMMV.
Well, I hope you forgive me a little plug here, but I just released my own DI framework for Objective-C: Syringe
https://github.com/tomekc/Syringe
It is simplistic and lightweight on purpose, my primary goal was to make it as not obtrusive as possible. I have a strong Java background, so I designed it after Google Guice and Spring.

Embedded language: Lua vs Common Lisp (ECL) [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 1 year ago.
Improve this question
Does anybody here have a experience with Common Lisp as a embedded language (using ECL)? If so, how good is ECL compared to Lua?
I haven't embedded CL before, but I've done it with both Lua and two particular Scheme implementations (Gambit-C and GNU Guile).
Scheme makes a great embedded language in my opinion, because it is flexible and not too bloated. Gambit-C is particularly awesome for this because it allows you to both run interpreted scripts, and also compile your code down to C. In my tests, Gambit-C's generated C code was only a little slower than handwritten C (for example, a particular test that ran 0.030s in C was 0.040 in Gambit!). Gambit also has a really nice FFI (foreign function interface), which is essentially just Scheme with special syntax for writing bindings to C libraries (ObjC and C++ are directly supported also). Gambit also has a very nice repl with some debugging capabilities.
Guile is also pretty nice, and it actually runs faster than Lua (fastest interpreted language that I currently know of -- Guile has made great progress in recent years). But since Gambit-C can compile to really fast code, I generally don't use Guile as much unless I intend to use interpreted code in the final version.
Lua has closures, but you won't get continuations like in Scheme, and you also won't get the macros. It's still possible to do a reasonable amount of functional stuff though. It won't have a fully featured object system (like CLOS in CL), but it does have tables and they can be used to implement both class-based inheritance and prototype-based inheritance quite easily. Also, Lua has an excellent C API that is really a pleasure to work with. It's stack-based, and designed in a way that you don't have to worry about the Lua side of memory management at all. The API is very clear and well organized, and there is a lot of great documentation and example code out there. Lua can't compile down, but it does use byte-code (always -- when you send code to the Lua VM, it always compiles that code down the byte-code first and then runs it).
Now, as for Common Lisp, I think that it would probably not make a very good language for embedding. The reason for this is just that CL is huge. Generally, it's desirable to embed a lightweight language because it's going to be using the platform/libs that you provide to it, and not so much external stuff.
So, I think you can't go wrong with either Gambit-C, Guile or Lua. They'll all really nice. CL is powerful, but I just think it's too big for embedding.
I can only agree that Lua is terrible. It works well when you have a pure imperative functional programming style but not if you try OO with large hierarchies, for example NEVER try to wrap a typical GUI toolkit like GTK in a Lua hierarchy, the performance will be just terrible.
I still use Lua because it's so lightweight that you can have dozens of interpreters running at the same time and end users understand to write code snippets with it while Lisp/Scheme has an expert only (lack of) syntax.
I would now add that mruby 3.0 is out and a great language to embed. Unfortunately in the meantime everyone went Javascript and Javascript only.

Automatic code quality tool for Ruby? [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 9 years ago.
Improve this question
One thing I really miss about Java is the tool support. FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking.
Is there anything that will check for simple bugs and / or style violations of Ruby code? Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.
I've recently started looking for something like this for Ruby. What I've run across so far:
Saikuro
Roodi
Flog
These might be places to start. Unfortunately I haven't used any of the three enough yet to offer a good opinion.
Saikuro and Flog can be good for getting a basic idea of code complexity. You can also use a tool like rcov to look at your test coverage.
There is a plugin for Rails projects that combine all those metrics into a single rake task. It is called metric_fu.
Projects I've found and tested recently:
https://github.com/railsbp/rails_best_practices
Seems to work, and gives sensible warnings
https://github.com/simplabs/excellent
Works, but quite a few false positives
https://github.com/troessner/reek
I disagree with most of the warnings from this tool, but it works
http://www.cs.umd.edu/projects/PL/druby/
This requires ocaml; I haven't tried it, but it looks like it might be good
http://roodi.rubyforge.org/
does not appear to be Ruby 1.9 compatible
https://github.com/gdb/ruby-static-checker
Is broken for me, and only catches name errors, so unit tests should cover that.
https://github.com/michaeledgar/laser
Doesn't compile for me
You might want to try out RuboCop. It is a Ruby code style checker based on the Ruby Style Guide. It's maintained pretty actively and it's based on standard Ruby tooling (like the ripper library). It works well with Ruby 1.9 and 2.0 and has great Emacs integration. I hope you'll find it useful!
Dust looks like it can help you find unused and useless code, which seems like it sort-of fits what you're after.
I'm not aware of any other such tools.
This problem is vastly harder to address in ruby than it is in java - you'll note that all those java tools brand themselves as using 'static analysis' of the code.
Static analysis of ruby code often isn't possible, because there isn't anything static that you can analyze (methods often get created at runtime and so on)
At any rate, some of these things are unneeded in ruby because the language builds them in.
For example, you don't need a coding standard to enforce that your classes are all NamedLikeThis because the code won't work if they aren't.
P.S. I have to add the standard disclaimer that those kind of tools can often be a bit of a red herring. You can spend all day making your code adhere to what the tool thinks it should be, and end up with more bugs than you started with.
IMHO the best solution is to write your code fluently so you can read it more easily. No amount of static analysis is going to be as good as a human reading code which clearly states what it is meant to do. Being able to do this is where ruby is light-years ahead of many other languages. I personally would recommend you aim your efforts at learning how to write more fluently, and educating your team about such things, than spending time on static analysis.
Another nice tool, although in early stages according to the author is reek:
http://reek.rubyforge.org/
reek currently includes very naive checks for the following code smells:
Long Method
Large Class
Feature Envy
Uncommunicative Name
Long Parameter List
Utility Function
Nested Iterators
Control Couple
Duplication
List item
Personally I think it still has too much false positives, but just looking at the output in some of my code helped me rethink some decisions about code style and architecture.
Code Climate is a SaaS tool that integrates through git and automatically "grades" your code. It notifies you via various channels if there a sudden drop in quality. Nice UI as well.
I didn't see this questions when asked, but a blog post I did might help as well. In it I cover a bunch of Ruby tools and specifically cover 4 code quality tools...
Roodi
Dust
Flog
Saikuro
It might also be worth checking out Towelie and Flay
http://devver.wordpress.com/2008/10/03/ruby-tools-roundup/
Now we have combined a lot of tools into an only Ruby code quality and metrics monitoring tool called Caliper. This might fit your needs well. It tracks various quality metrics over the life of a project.
Caliper - improve your Ruby code
There is also excellent. I haven't tried it yet, but it too looks promising.

Resources