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 recently came across a new programming language - "The Dog programming language"
I was searching for a compiler for this language.
I found an article about the Dog language.
I found a Dog compiler written in the Perl language but I don't know how to use it.
Thanks in advance!
How to use the Perl DOG compiler
Windows
First, install perl and make sure it is in your path:
Download it here: http://www.perl.org/get.html
You can use strawberry perl (possibly the other one too).
Then, download the compiler from http://viewsourcecode.org/code/perl/dog.txt and save it as dog.txt(you can actually name it whatever you want but these instructions assume you named it dog.txt).
Make a DOG source code file. Let's assume it is called helloworld.dog.
Here's some code you can put into helloworld.dog:
bark "Hello world!\n"
Run it in a terminal (command prompt):
perl dog.txt helloworld.dog
Linux/Mac/Unix
Download the compiler:
wget http://viewsourcecode.org/code/perl/dog.txt
Make it executable:
chmod +x dog.txt
Make a DOG source code file. Let's assume it is called helloworld.dog.
Here's some code you can put into helloworld.dog:
bark "Hello world!\n"
Run it:
./dog.txt helloworld.dog
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
To Zerobrane users, since this is not a question on lua :
I use Zerobrane for editing lua programs that are to be used with LuaLatex. Very nice !
I make all tests there before using the developments in LuaLatex. So, at the beginning, the programs are run there. I need to tidy up this part, on ZeroBrane, by making files hierarchical, with a master file and slave files around.
Once again, it is a question about ZeroBrane, not about how I use the file within LuaLatex (I know enough about doFile, luaexec and co)
Does this exist ?
I saw PaulK passing by, if he could drop a line, it would be appreciated ...
An "include mechanism" as you call it is usually a language feature, not some feature of an IDE.
Lua provides various functions for running code from other files.
dofile, load, loadfile, require, ...
The most convenient and common is require which will find a file by its name in a given set of directories and execute its contents.
Read this:
https://www.lua.org/manual/5.3/manual.html#6.3
https://www.lua.org/pil/8.1.html
https://www.tutorialspoint.com/lua/lua_modules.htm
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
When I started to learn about testing a program, all I learned is to
use a library or package in the same language as the tested program.
For example,
if a tested program is written in Python, its testing program is also written in Python and uses UnitTest class in the python
standard library
if a tested program is written in C++, its testing program is also written in C++ and uses some test library in C++.
I just saw a project where the tested program is written in C++, and
the testing program is written in Python. Instead of making the
Python testing program to call the C++ tested source code, the
Python testing program loads and executes the executable compiled
from the C++ tested program.
General in software engineering, for a project, how is it decided to choose the same or a different programming language to test a program?
Thanks.
I assume that you refer to unit tests, at least in the widest sense.
Normally you will use the same language for testing, just for the sake of simplicity. Using a different language just produces communication overhead between the tests and the tested code.
The only case where using a different language could make sense is when the language of your tested code is especially cumbersome (think Assembler or COBOL) or if you are not familiar with it. But the latter case actually does not count because unit tests and the tested code are normally implemented by the same developers.
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 7 years ago.
Improve this question
I've been meaning to try out rebol (or red). I think it might be the perfect fit for my next project.
I've downloaded and tested out red 0.5.4, and REBOL/View 2.7(http://www.rebol.com/download-view.html)
However, there are a couple of roadblocks for a complete beginner to rebol:
Red seems to be still in alpha so it is out of the question
There seems to be 3+(?) branches: REBOL3 - what is the difference between the different branches? I'm not sure what to start on
Most of the documentation on the internet is for rebol 2 and documentation explaining the differences between rebol 2 and 3 is.. non existent? (case in point: parse is different)
So, my question is, if I were to develop a (Windows) gui application with http access (including http authentication) where should I start?
Should I use rebol 2, rebol 3(ren c), or red?
p.s. first question ever!
Red is in alpha so you've already excluded it. Rebol 3 with view is not supported by anyone as far as I know. So this leaves you with Rebol 2. I think you can still purchase a license for the SDK. And there are many people who can answer support questions.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I never programmed lua before, now I have to find a part in a script that generates a webinterface and verify a variable, so that it may only contain a valid hostname (only letters and the minus-sign)
How would I program this in lua?
Is there a simple manual, where to find such things (like php.net for PHP)
If you're looking for a simple Lua manual, one exists over at the official page: http://www.lua.org/manual/5.2/
The resource linked by plalx explains the basics of lua pattern matching. So does: http://www.lua.org/pil/20.1.html
Lpeg is a good pattern matching library: http://www.inf.puc-rio.br/~roberto/lpeg/
For a look at other pattern matching libraries, have a look at: http://lua-users.org/wiki/LibrariesAndBindings under the heading "Text Processing"
Try string.match(host,"^[%w%-]+$")~=nil.
I've never programmed in lua either, but it seems that it has a set of powerful pattern matching functions that you could use.
Just have a look at http://lua-users.org/wiki/PatternsTutorial
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
I have found a lot of useful information on using Agda as a proof system. I have found virtually no information on using Agda to write usable programs. I cannot even find a "hello world" example that compiles with the most recent version of Agda.
So,
Are there any good tutorials on Agda as a programming language?
Are there other languages of a similar nature (lazy functional dependently typed) that have more mature documentation for using them as a programming language? (I found tons of great documentation on Coq, but, again, no "Hello World").
To print a string in Agda, you need the std lib. You can find a "hello world" example here for Agda 2.2.6 and std lib 0.3. This example doesn't work for current Agda 2.3.0 and std lib 0.6. I read some sources in std lib 0.6, and find that the following one works:
module hello where
open import IO.Primitive using (IO; putStrLn)
open import Data.String using (toCostring; String)
open import Foreign.Haskell using (Unit)
main : IO Unit
main = putStrLn (toCostring "Hello, Agda!")
To compile it, you need
save it to "./hello.agda"
download lib-0.6.tar.gz, and unpack it to somewhere, say DIR
cd DIR/ffi && cabal install
agda -i DIR/src -i . -c hello.agda
On my MacOSX Lion with ghc-7.4.2 and cabal-1.16.0, this example works fine. I get an executable program named "hello" with size 19.1M.
This is nascent, but one-day might become a useful resource:
https://github.com/liamoc/learn-you-an-agda