Re:Felix: A compiled (to C++) scripting language
by _yosefk on Sunday July 10, 2016 @12:36PM
(#12066148)
The math examples look interesting, standard math notation and all. Though if I got it right, you get standard math notation with the help of TeX when viewing source code, I'm not sure about editing source code (I sure would rather write Matlab or numpy notation than use TeX in source code.)
I guess one always wants to hear an elevator pitch of what a language does that is special relatively to relevant competition. What does Felix have that languages X and Y, its closest competitors, don't have?
Re:Felix: A compiled (to C++) scripting language
by dmix on Sunday July 10, 2016 @09:38PM
(#12068326)
Took about 5 clicks to see a decent code example. This should be priority #1 on your homepage. A simple single-page program is ideal or examples for each of the listed points.
Re:Felix: A compiled (to C++) scripting language
by masukomi on Monday July 11, 2016 @08:18AM
(#12070489)
I have to agree. I clicked "Tutorial', and upon seeing the result thought I'd accidentally clicked something else... This is completely lacking in a user friendly quick intro to the language, what it looks like, and how "cool" (or not) it is to use.
Re:Felix: A compiled (to C++) scripting language
by hellofunk on Sunday July 10, 2016 @01:57PM
(#12066446)
> var a : int ; // uninitialized is ok
This seems like an odd choice when creating a new language. Most modern languages (C++11, Swift) have been introducing new declaration techniques or requiring all variables to be initialized at declaration, as this prevents a large class of bugs.
Re:Felix: A compiled (to C++) scripting language
by doomrobo on Sunday July 10, 2016 @06:25PM
(#12067564)
Unintialized values are fine as long as the compiler can prove that the value is never used until it is initialized. See https://is.gd/gDJCeG as an example. Try deleting the else block.
Re:Felix: A compiled (to C++) scripting language
by hellofunk on Monday July 11, 2016 @05:34AM
(#12069896)
That's fine, and now that I think about it, in C++ just setting the flag to make all compiler warnings also errors, it too would prevent compilation (I think?).
Re:Felix: A compiled (to C++) scripting language
by unsignedqword on Sunday July 10, 2016 @04:32PM
(#12067143)
IMO lack of initialization in a language should be explicit, not implicit, e.g. DLang:
import std.array : uninitializedArray;
int a; /+ defaults to '0' +/
int b = void; /+ not initialized +/
bool[5] c; /+ defaults to array of 'false' +/
auto d = uninitializedArray!(bool[])(5); /+ not initialized +/
Re:Felix: A compiled (to C++) scripting language
by maxlybbert on Sunday July 10, 2016 @03:04PM
(#12066745)
I believe Felix has a special syntax to combine declaration and initialization (well, more like a shortcut; IIRC they have type inference for those cases). The code sample just shows that if you need to separate declaration and initialization, you can.
I don't know about Felix, but even the simplest C compilers I use are able to warn me when they can't verify that a variable is initialized before first use. It's not that hard. And, no, you don't have to solve the halting problem as long as you're clear what you promise to warn about. There are cases where you can trivially prove initialization or failure to initialize. Promise to get those cases right, and to warn on anything else.
The README and INSTALL files are also interesting; highlighting that Felix (claims to) produces very fast code/programs and that gcc 5.1 is recommended/needed to build.
Interesting looking language - I wonder how it ends up compared to Nim (with both the C and C++ backends). I suspect there's been more focus on performance on the Felix side - but it's hard to tell. The documentation section on garbage collection (for Felix) was blank.
Re:Felix: A compiled (to C++) scripting language
by colejohnson66 on Monday July 11, 2016 @12:20AM
(#12068872)
That "free for any use" license is quite unpleasant. It's not really any different than the WTFPL. By not even including a mention of no warranty at all, you're opening yourself up to a wide variety of possible lawsuits due to "implied warranty".
The "license" doesn't even say if you can /modify/ the code. It just says you can /use/ it. You could get in some big trouble for modifying the code if the author decided to sue you over changing the code at all. In fact, it just says the software is free to use, not the code.
I might even go as far as saying that because just the software is free to use, it's no different than a proprietary program you can't modify at all, but you can see it's source.
Re:Felix: A compiled (to C++) scripting language
by hellofunk on Sunday July 10, 2016 @02:37PM
(#12066624)
You're right, I thought this was a new language. The repo history goes back at least as far as 2001. I'm struggling to see the point to this language; what does it offer over C++ directly?
Re:Felix: A compiled (to C++) scripting language
by spriggan3 on Sunday July 10, 2016 @06:46PM
(#12067632)
> Or even Go
lol. Felix has Sum types, meta types, pattern matching, algebric types, unions , sets, records, channels ... Go has what? a rigid type system and channels ...
Re:Felix: A compiled (to C++) scripting language
by jjnoakes on Monday July 11, 2016 @09:54AM
(#12071023)
I'm interested in other statically-typed languages that compile to C or C++ source (which can be then copied to some other machine and built there, or cross-compiled for it).
I've looked at Rust (which I'm writing a transpiler for), Felix, Haxe, Nim, and Native Script. Are there others?
Re:Felix: A compiled (to C++) scripting language
by wainstead on Sunday July 10, 2016 @12:26PM
(#12066113)
One wonders why a project would choose a copyrighted image for its logo in this day and age. Felix currently belongs to NBCUniversal, according to Wikipedia.
Re:Felix: A compiled (to C++) scripting language
by logn on Sunday July 10, 2016 @12:35PM
(#12066140)
"This work is in the public domain because it was published in the United States between 1923 and 1963 and although there may or may not have been a copyright notice, the copyright was not renewed." - https://en.wikipedia.org/wiki/File:Felix_the_cat.svg ... although then someone disputed that on the Wikipedia page.
Where are other biggish examples?
The "styles" page has the biggest bulk of interesting code that I've found in introductory pages: http://felix-lang.org/share/src/web/advocate/styles.fdoc
I guess one always wants to hear an elevator pitch of what a language does that is special relatively to relevant competition. What does Felix have that languages X and Y, its closest competitors, don't have?
Elixir is a good example: http://elixir-lang.org/
This seems like an odd choice when creating a new language. Most modern languages (C++11, Swift) have been introducing new declaration techniques or requiring all variables to be initialized at declaration, as this prevents a large class of bugs.
Using 'auto' in C++ forces out uninitialized variables as well.
I don't know about Felix, but even the simplest C compilers I use are able to warn me when they can't verify that a variable is initialized before first use. It's not that hard. And, no, you don't have to solve the halting problem as long as you're clear what you promise to warn about. There are cases where you can trivially prove initialization or failure to initialize. Promise to get those cases right, and to warn on anything else.
perhaps in particular:
https://github.com/felix-lang/felix/tree/master/demos
The README and INSTALL files are also interesting; highlighting that Felix (claims to) produces very fast code/programs and that gcc 5.1 is recommended/needed to build.
Interesting looking language - I wonder how it ends up compared to Nim (with both the C and C++ backends). I suspect there's been more focus on performance on the Felix side - but it's hard to tell. The documentation section on garbage collection (for Felix) was blank.
OCaml 30.6% C 20.5% HTML 13.1% C++ 13.0% Python 11.2% TeX 6.7%
Wonder how that came about...
The feature list looks quite impressive:
* generates highly optimised ISO C++
* advanced resource manager organises compilation and linkage
* often runs faster than C
* glueless binding to C and C++ libraries
* lightweight threads with channels
* asynchronous network I/O
* thread safe garbage collection
* strictly statically typed
* overloading
* first order parametric polymorphism
* polymorphism with constraints
* multitype Haskell style type classes
* type classes with real semantic specification
* semantics can be checked by theorem provers
* strong functional subsystem
* pattern matching
* first class function, sum, and product types
* Tre based regexp processing built in
* bindings to Gnu GMP and Gnu GSL included
* user definabled and inline extensible grammar
* builds on all platforms
* runs on all platforms
* open source FFAU (free for any use) licence
The "license" doesn't even say if you can /modify/ the code. It just says you can /use/ it. You could get in some big trouble for modifying the code if the author decided to sue you over changing the code at all. In fact, it just says the software is free to use, not the code.
I might even go as far as saying that because just the software is free to use, it's no different than a proprietary program you can't modify at all, but you can see it's source.
https://news.ycombinator.com/item?id=6047560
lol. Felix has Sum types, meta types, pattern matching, algebric types, unions , sets, records, channels ... Go has what? a rigid type system and channels ...
I can't download pre-compiled tarballs from http://felix-lang.org/$/usr/local/lib/felix/tarballs
I followed the link Felix home -> Download -> Prebuilt Felix binaries.
I've looked at Rust (which I'm writing a transpiler for), Felix, Haxe, Nim, and Native Script. Are there others?