5 ms·
Did you have a look at e.g. https://root.cern.ch/root/html534/guides/users-guide/CINT.html https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... and h
by Rochus 5y ago
Did you have a look at e.g. https://root.cern.ch/root/html534/guides/users-guide/CINT.html https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... and https://root.cern/cling/ https://root.cern/cling/?
> Lua ... It has unfamiliar syntax ... start indexing at 1
Syntax is not unfamiliar, just more Pascal like; if you use LuaJIT you can use zero based indices and a powerful FFI for direct C code integration.
- germandiago 5y agoWell, by this I mean "unfamiliar to me", of course. Lol. Actually Lua is something to consider from the point of view of usage: it is an industry standard actually. However, all those small quirks in semantics... and classes can be done in many ways (that is what I understand, via metatables)... In ChaiSCript or Wren there is one true way and you are done. You might like it or not, but it leads to less confusion, especially if you use most of the time what is in the mainstream. This is by no means a bad thing in itself, it is just about how ergonomic or time-consuming it could be for myself: I just feel more comfortable with ChaiScript, Wren or Squirrel than with Lua. Even AngelsCript is also more similar to what you already have. So when exposing APIs there is much less friction. Truth to be told, there is also https://github.com/ThePhD/sol2 https://github.com/ThePhD/sol2 which looks great and something to consider. It makes binding things quite easier and gives you object-oriented Lua. You could rely on that. It was just my subjective choice. There is no 100% right choice. Probably, if I found people that are comfortable with Lua I would use that. But the case is that this is a project of mine as it stands now.
- jcelerier 5y ago> Syntax is not unfamiliar, just more Pascal like; how is that not unfamiliar
- Rochus 5y agoWell, why would you then consider Python to be familiar?
- oblio 5y agoBecause Python is 100000x more popular than Pascal in 2021?
- germandiago 5y agoYou make a good point. I started my Computer Science and Engineering degree (I am european, not american, so the equivalent looks like kind of a merge of both areas) with Python, C and C++ on the programming side. Pascal was discarded a few years back in my university. And yes, by familiar I mean exactly what you mean: you see nowadays Java, Python, C++, C, C#, but Pascal is disappeared. Disappeared since long ago since I do not know even the syntax myself by casual reading around.
- Rochus 5y agoPython syntax is more similar to Pascal than to e.g. Java or JS. "Modula-3 is the origin of the syntax and semantics used for exceptions, and some other Python features." (from https://docs.python.org/3/faq/general.html#why-was-python-created-in-the-first-place https://docs.python.org/3/faq/general.html#why-was-python-cr...). Also the predecessor languages ABC and SETL were in the Algol tradition. > Python is 100000x more popular than Pascal It's about factor 8 on https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/ or factor 3 (in score) on https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2020 https://spectrum.ieee.org/static/interactive-the-top-program..., whatever you prefer as a reference. Delphi (which is Object Pascal) is still a widely used language.
- oblio 5y agoI generally go by job listings. It's trivial to find Python jobs, Pascal/Delphi jobs are very rare.
- Rochus 5y agoMaybe you can post a link to a job site where there are 100000x more Python than Pascal/Delphi/Ada jobs. Btw. you can filter the IEEE ranking by jobs which seems to correspond well with what I see on monster or indeed. Anyway, the discussion was about whether the Lua or Pascal style syntax is unfamiliar or not.
- coldtea 5y agoIn that it still refers to a hugely popular family of languages...
- jcelerier 5y agoChinese is also a hugely popular language, does not mean that it is familiar to a large amount of humans
- coldtea 5y agoThe analogy breaks as Pascal knowledge is not confined to one geographical area or ethnicity. The same for languages inspired by Pascal syntax, with are tons. No matter how you slice it or dice it, Pascal and Pascal-like syntax are not some obscure niche languages...
- solipsism 5y agoIt's a subjective word. It's unfamiliar to people who are not familiar with Pascal. It's familiar to people who are familiar with Pascal. Jesus... Look at yourself, HN.
- jcelerier 5y ago> The analogy breaks as Pascal knowledge is not confined to one geographical area or ethnicity. no, it is confined to people who learned Pascal ? I could start learning chinese with duolingo just as easily as I could start learning pascal with some web tutorial, it does not mean that either are familiar to me.
- germandiago 5y agoAs for looking at CINT, CLing, yes I did. I prefer to use a dynamic language with coroutines out of the box. It is actually what I was looking for besides ease of binding it and "familiarity" in semantics/syntax in a broad, imprecise way I defined for myself.
- pierrec 5y ago> if you use LuaJIT you can use zero based indices and a powerful FFI Not entirely, Lua standard libraries still expect everything to be one-indexed, while FFI structures are zero indexed. So with LuaJIT you often end up with a mix of 0 and 1 indexed code, which in my experience was workable but definitely a pain point.
- Rochus 5y agoYou should avoid the Lua C API in LuaJIT because it is not supported by the JIT (i.e. it makes your code running in the interpreter instead of the JIT). Using zero based indices in Lua code running on LuaJIT works well.
- pierrec 5y agoI'm not talking about the Lua C API, but things as simple as this: > stuff = {"one", "two", "three"} > stuff[1] one These native Lua structures are baked in, and they're a lot more flexible than FFI structures - presumably if you're using Lua, it's because you want to take advantage of that flexibility and those affordances. FWIW I've written a lot of LuaJIT, and usually I kept the lower-level FFI stuff separate from the higher-level code using Lua data structures, so I rarely encountered that discrepancy between them, but still something to keep in mind.
- Rochus 5y agoYou can e.g. do > stuff = { [0]="one", [1]="two" } > print(stuff[0]) one Works well; I wrote e.g. https://github.com/rochus-keller/Smalltalk#a-smalltalk-80-interpreted-virtual-machine-on-luajit https://github.com/rochus-keller/Smalltalk#a-smalltalk-80-in... that way. EDIT: even this works > stuff = { [0]="one", "two", "three" } > print(stuff[0]) -> one > print(stuff[1]) -> two
- pansa2 5y ago> stuff = { [0]="one", "two", "three" } In this case, is it possible to make iteration start with the element at index 0? Maybe by implementing a custom version of `ipairs`?