Re: Jinja2 syntax for conditionals
- From: Sam Thursfield <sam thursfield codethink co uk>
- To: Tristan Van Berkom <tristan vanberkom codethink co uk>, buildstream-list gnome org
- Subject: Re: Jinja2 syntax for conditionals
- Date: Tue, 26 Sep 2017 09:58:01 +0100
On 21/09/17 04:27, Tristan Van Berkom wrote:
Warning: This email may be straying a bit off topic...
Agreed! I decided not to reply last week, but hopefully with the dust
settled a bit I can be forgiven for one last attempt to work out where
our thinking diverges...
I don't see this as the question at all. Either way we're adding logical
expressions to what was previously a serialization format, and making
something that is (a) a serialization format with syntax sugar for
variants, or (b) something else.
Probably late to reply this, and probably veering off topic, but I re-
read this while replying to Sander and feel that the above is an
inaccurate assessment.
We already stray from pure YAML in a couple of places for our
serialization, for instance we parse out urls expressed as aliases and
split on the ':' character. I dont think this causes the format to no
longer be a serialization format.
The existing 'arches' and 'variants' are logical expressions as much as
they would be if expressed a bit differently for the user's
convenience.
I think you are making a deep association of S-Expressions themselves
with the lisp programming language, while I on the other hand see them
as an merely an easy to parse, more structured and defined approach to
CSV (it sits somewhere in between CSV and JSON) - sending S-Expressions
over a wire for instance is quite typical and I feel is akin to restful
JSON apis, these are just simple data serialization mechanisms, one of
which just happens to be used as a vehicle for some simple but turing
complete programming languages.
I agree with this. S-Expressions just represent lists of atoms and I
consider them to be a data format. Lisp is a family of programming
languages where lists of atoms are interpreted as programs -- the first
item in the list is the name of a function which the interpreter will
execute and will pass the rest of the list as arguments. (It's not
always that simple, but you know what I mean).
In the example that you attached earlier on in this thread, you had a
200 line program which would parse S-Expressions into a list and then
execute a function based on the first item in the list. To me, that's
already starting to look like a minimal, non-Turing-complete programming
language.
Sam
--
Sam Thursfield, Codethink Ltd.
Office telephone: +44 161 236 5575
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]