Rapid prototyping is because it requires less explicit up front design due to dynamic types.
Artificial Intelligence is because metaprogramming is easier in homoiconic languages.
Rapid prototyping is because it requires less explicit up front design due to dynamic types.
Artificial Intelligence is because metaprogramming is easier in homoiconic languages.
For a while now I have felt that the reason for the creation of languages like Python and Ruby is simply a response to the pain of one such as C++. Now that we have modern languages like Rust and Go, what is there to be gained from sacrificing a type system?
The type system definitely helps with long term maintainability (and therefore fast iteration) but when your goal is to whip out a Proof of Concept for a greenfield project Ruby wins for me hands down. (Provided it isn't overly complex, defined as "can be completed in an hour or two").
I say this not just from personal preference, but I've proctored many timed coding challenges that were language agnostic. The challenge involved consuming data from a handful of API endpoints and compiling a response. Most statically typed solutions took twice the time of a dynamically typed one. We catered the time limit to the static case and it was a simple pass fail so no bonus points for doing it faster, but there was a strong advantage to the dynamic languages.
Note: This is very much alleviated with typed interchange formats like protobuf.
Edit: I don't mean this to be snarky, I just feel that it is not a very good experiment to draw conclusions from.
It was for all candidates, meant to test ability to understand a problem and prototype a solution quickly.
Edit: most candidates did Java/Scala/Python/Ruby.
If I'm hacking together a quick and dirty prototype, I might not even care what type I get back from that operation as long as it's in the ballpark. Using Ruby means I just don't have to worry about it for longer than it takes me to type `a + b`. If I used Haskell, or Rust, or whatever, I have to be explicit. That's additional work, however minimal, and in my experience it really does add up.
Of course, if I'm writing code that's going to be in production, this sort of thing is highly irresponsible and using a strongly typed language will help me to avoid numerical errors that would not even be runtime errors in e.g. Ruby; they'd be silently swallowed instead. That's extremely valuable. And if development of my prototype is going to span multiple days or more, strong types and compile-time type checking are going to reduce my mental workload since I don't have to remember how everything fits together; it's explictly annotated throughout the code and checked every time I build.
I think you mean JSON where the schema isn't defined. If you have full control over the JSON you're consuming, you control the schema. Typed languages aren't any worse than dynamic languages in this case.
> Rapid prototyping is because it requires less explicit up front design due to dynamic types.
Many types languages have a REPL environment specifically for this reason. In my experience, it's not any slower.
> Artificial Intelligence is because metaprogramming is easier in homoiconic languages.
I have no experience here, thus I will assume you are correct.
Artificial Intelligence is because
metaprogramming is easier in homoiconic
languages.
Homoiconicity is something you can add to any language, dynamically or statically typed, simple or complex, it doesn't matter. It used to be belived that only syntactically simple languages like Lisp are suitable for homoiconic extension, but this myth was destroyed by Walid Taha and his development of the MetaML family of languages.For an overview of how to add homoiconicity to languages, see https://arxiv.org/abs/1602.06568
Can you elaborate on this? Why are or what about homoiconic lnagunages make them more suitable for metaprogramming and AI in general?
Thanks
The relation to AI is an assumption that AI and metaprogramming are connected. This is probably debatable, but it makes sense to me (and others) that AI development would benefit from being able to easily generate code and modify itself, much like you or I would learn a new skill.
If what you want is a system that rewrites itself, then you definitely want homoiconicity. It also helps if everything is one big expression.
Let's say you want to write an evolutionary algorithm that rearranges fragments of its code and runs it. More successful functions make it to the new generation. You want LISP for that.
Realistically, you could probably do this on any abstract syntax tree. But the problem is that unless your language is homoiconic, what you get back might not actually be valid in your language. So, homoiconicity gives you bidirectional support for rearranging the AST and still getting something you can read.
It's also just a lot easier to write something that looks at the code and does computation on it when that code is also data.
But, like I said, I'm not sure many people are actually doing this these days. It was popular back in the day. It's not clear that it's the right way to do things.
Scheme is a popular extension language. You could use it the same way Torch uses Lua.
...the first thing I do when encountering JSON in TypeScript these days is to add type definitions to describe the schema. If I have a hard time describing the schema to TypeScript, I'm going to have an even worse time trying to keep it straight myself.