- neos - 15 Updates
- new benchmark for my read/write algorithm... - 2 Updates
- is there any UB in this integer math... - 3 Updates
- Question about relaxed memory ordering - 4 Updates
- Dekker's Algorithm on atomics with memory ordering - 1 Update
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 03:16AM Hi! Work on neos my universal compiler that can compile ANY programming language is progressing. Initial language implementations will be Ada, JavaScript, Python, Lua and Forth then maybe C. /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
"Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com>: Feb 23 08:42PM -0800 On 2/23/2019 7:16 PM, Mr Flibble wrote: > Work on neos my universal compiler that can compile ANY programming > language is progressing. Initial language implementations will be Ada, > JavaScript, Python, Lua and Forth then maybe C. I like and use some of those languages. Well, if you really get some free time, please try to give C a chance? |
Cholo Lennon <chololennon@hotmail.com>: Feb 24 01:47AM -0300 On 2/24/19 12:16 AM, Mr Flibble wrote: > Work on neos my universal compiler that can compile ANY programming > language is progressing. Initial language implementations will be Ada, > JavaScript, Python, Lua and Forth then maybe C. It sounds interesting. Could you describe your compiler? Is something similar, for example, to clang/LLVM? What architecture/platform are you going to support? Regards -- Cholo Lennon Bs.As. ARG |
Ian Collins <ian-news@hotmail.com>: Feb 24 06:08PM +1300 On 24/02/2019 16:16, Mr Flibble wrote: > Work on neos my universal compiler that can compile ANY programming > language is progressing. Initial language implementations will be Ada, > JavaScript, Python, Lua and Forth then maybe C. It's not April first yet... -- Ian. |
Melzzzzz <Melzzzzz@zzzzz.com>: Feb 24 09:39AM >> language is progressing. Initial language implementations will be Ada, >> JavaScript, Python, Lua and Forth then maybe C. > It's not April first yet... Perhaps he travels in time? -- press any key to continue or any other to quit... |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 11:20AM On 24/02/2019 04:47, Cholo Lennon wrote: > It sounds interesting. Could you describe your compiler? Is something > similar, for example, to clang/LLVM? What architecture/platform are you > going to support? The compiler is language agnostic (i.e. contains no C++ code specific to any one programming language). A language schema file that describes the syntax and semantics of the language is an input to the compiler; the format of the schema file is Relaxed JSON so is very easy to write. The target of the compiler is my custom bytecode VM which will have a JIT. My main project "neoGFX" (an app/game creation framework) will use neos as its scripting engine. The ability of my framework to be able to run scripts written in your favourite programming language is a unique selling point I think. /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 11:21AM On 24/02/2019 05:08, Ian Collins wrote: >> language is progressing. Initial language implementations will be Ada, >> JavaScript, Python, Lua and Forth then maybe C. > It's not April first yet... I am being quite serious Ian and neos is a serious project: https://github.com/i42output/neos /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 24 12:41PM On Sun, 24 Feb 2019 11:20:50 +0000 > its scripting engine. The ability of my framework to be able to run > scripts written in your favourite programming language is a unique selling > point I think. Not necessarily unique. You might be interested in GNU guile, whose VM (and compiler) is intended to be usable with different compiler front ends. However, at present front ends are only available for scheme, early ECMAscript (I think most of ECMAscript 3) and emacs lisp. A lua front-end is said to be "underway" but I wouldn't stake too much on it, as ambition often over-reaches resources. The compiler for the development version of guile (version 2.9.1) does JITing from bytecode to native code[1] and the code it emits is reasonably fast - about 10 times slower than C and considerably faster than python. The main author of that VM/compiler is or was also involved professionally in v8 and I believe also firefox, so he does know about the subject. Yours looks even more ambitious. I wish you well with it. [1] https://www.gnu.org/software/guile/docs/master/guile.html/Just_002dIn_002dTime-Native-Code.html |
bart4858@gmail.com: Feb 24 05:35AM -0800 On Sunday, 24 February 2019 11:21:00 UTC, Mr Flibble wrote: > its scripting engine. The ability of my framework to be able to run > scripts written in your favourite programming language is a unique selling > point I think. Actually in that language or just using its syntax? Because you mention Ada and Python among others. Ada compilers I'd heard can take many man years to write. While Python is another huge language, of which half the functionality depends on standard libraries likely written in C. Another problem is that someone using what looks like Python might expect to be able to install and deploy any of tens of thousands of libraries, all with their own special requirements. So if some are saying such a project appears to be over-ambitious, then I would agree. Especially if there will be the ability to write projects in mixed languages (how will Python call a function in Ada; how will Ada call a function in Javascript?). |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 02:08PM >> scripts written in your favourite programming language is a unique selling >> point I think. > Actually in that language or just using its syntax? The language. > Because you mention Ada and Python among others. Ada compilers I'd heard can take many man years to write. While Python is another huge language, of which half the functionality depends on standard libraries likely written in C. The core languages will be implemented; what % of standard libraries I provide will depend on time available. > Another problem is that someone using what looks like Python might expect to be able to install and deploy any of tens of thousands of libraries, all with their own special requirements. > So if some are saying such a project appears to be over-ambitious, then I would agree. Especially if there will be the ability to write projects in mixed languages (how will Python call a function in Ada; how will Ada call a function in Javascript?). Python won't be calling a function in Ada because the Python and the Ada no longer exist after compilation: they are transformed into a language agnostic intermediate form. /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
gazelle@shell.xmission.com (Kenny McCormack): Feb 24 02:26PM In article <c7vcE.37718$5U6.9077@fx03.fr7>, >>> JavaScript, Python, Lua and Forth then maybe C. >> It's not April first yet... >I am being quite serious Ian and neos is a serious project: I've thought since I first saw this thread that this is an elaborate trolling of RCH (*). (*) Who also is planning to singlehandedly, all by himself, re-invent the past 70 years of computing ecosystem. P.S. Isn't your project essentially the same general idea as MS's .NET? -- The people who were, are, and always will be, wrong about everything, are still calling *us* "libtards"... (John Fugelsang) |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 02:30PM On 24/02/2019 14:26, Kenny McCormack wrote: > (*) Who also is planning to singlehandedly, all by himself, re-invent the > past 70 years of computing ecosystem. > P.S. Isn't your project essentially the same general idea as MS's .NET? Kind of: the main difference being that I don't have to recompile any binaries to support a new language as long as the semantic concepts are already available: all that is required is a new language schema file describing the language. If there are any new semantic concepts required then they can be added with a plugin using neos's plugin architecture. /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Feb 24 04:11PM +0100 On 24.02.2019 12:20, Mr Flibble wrote: > syntax and semantics of the language is an input to the compiler; the > format of the schema file is Relaxed JSON so is very easy to write. > The target of the compiler is my custom bytecode VM which will have a JIT. I detect an extreme /internal feature/ creep here, which may stand in the way of the community ever getting a finished NeoGFX (whatever). Been there, done that. Containing feature creep = very important. May feel like cutting one's foot or arm off, why would one do that? But actually it's a question of curbing an effort to /grow/ a new arm or foot, that one envisions would simplify other tasks considerably; looked at that way it's silly. > as its scripting engine. The ability of my framework to be able to run > scripts written in your favourite programming language is a unique > selling point I think. Cheers!, - Alf |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 24 03:16PM On 24/02/2019 15:11, Alf P. Steinbach wrote: >> The target of the compiler is my custom bytecode VM which will have a JIT. > I detect an extreme /internal feature/ creep here, which may stand in the > way of the community ever getting a finished NeoGFX (whatever). There is no feature creep going on: it has always been the intention that neoGFX will have a scripting engine but it makes sense to make the engine a separate project. > Been there, done that. I am not. > foot or arm off, why would one do that? But actually it's a question of > curbing an effort to /grow/ a new arm or foot, that one envisions would > simplify other tasks considerably; looked at that way it's silly. Your analogy doesn't hold because there is no feature creep. /Flibble -- "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Feb 24 07:44AM -0800 "Ravioli. "Ravioli. "Ravioli." -- Rick C. Hodgin |
"Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com>: Feb 23 03:50PM -0800 On 2/23/2019 12:31 PM, Chris M. Thomasson wrote: > Writer A spins on CAS because it failed! > Reader C releases read access. > Writer A spins on CAS because it failed! A Reads your count. B does a CAS. A spins on CAS. failed. C does a CAS. A spins on CAS. failed. B does a CAS. A spins on CAS. failed. Your CAS will spin on basically any interference like this. This can be a real issue. Think of the reason why there is compare_exchange_weak, and compare_exchange_strong in the first place. Think of spurious failures that have nothing to do with another CAS... Study up on compare_exchange_weak. |
Bonita Montero <Bonita.Montero@gmail.com>: Feb 24 03:06PM +0100 1. You omitted what I determied from my benchmark. According to my benchkark an echange succeeds in average about 2,5 times until the cacheline is moved to a different core (Ryzen 7 1800X, but I think that's not very different with Intel-CPUs). 2. When multiple writers are contending on the writer-flag it's very likely that there will be also kernel-waiting and signalling. That's my magnitudes slower than the CAS-loop. So the performance of the latter doesn't count here any more. 3. The only case where XADD could make sense is when there is an active writer and a reader is registering to gain shared ownership. |
David Brown <david.brown@hesbynett.no>: Feb 24 11:53AM +0100 On 23/02/2019 18:17, Bonita Montero wrote: >> So the compiler knows that "x + 1 > x" ... >> is true, and "2 * x / 2" is "x", and so on. > I think it's better for a compiler not to assume this. You are entitled to your preferences here - and that is why gcc has the "-fwrapv" switch to let people choose. But be aware that you are in the minority, and you cannot assume compilers will cater to you unless they explicitly say so. > few advantages of such optimizations, but the disadvantage is > that the compiler does many things that you would not intuitively > expect from it. Programmers write code all the time that benefits from such re-arrangements. People rarely write them explicitly, of course, but inlining, constant propagation, macro expansion, etc., can often result in expressions that can be simplified in such ways. > set bit that you shift from the lowest position to the highest > and beyond to empty. In such and many other cases, one of the > compilers would get in the way. Such operations are /not/ "very handy". They are the kind of things that only a small fraction of programmers ever need to do, and they only need to do it very occasionally. And C (and C++) has a feature for handling such cases - unsigned integer types. |
Bonita Montero <Bonita.Montero@gmail.com>: Feb 24 12:30PM +0100 > You are entitled to your preferences here - and that is why gcc has the > "-fwrapv" switch to let people choose. That should be the default because ihe setting that comes with the maximum assumtion is worth nothing and break intuitive assumptions. |
David Brown <david.brown@hesbynett.no>: Feb 24 12:57PM +0100 (Please post correctly, with attributions. You will find it much easier to use Usenet groups if you get a newsreader and newsserver, rather than Google's broken "groups" interface. I recommend Thunderbird and news.eternal-september.org as free solutions if you don't have any other preferences.) On 24/02/2019 12:30, Bonita Montero wrote: >> the "-fwrapv" switch to let people choose. > That should be the default because ihe setting that comes with the > maximum assumtion is worth nothing and break intuitive assumptions. I've tried to explain, but apparently I have failed. If you can point to things I wrote that you don't understand, or don't agree with, I'll be happy to try to go in more detail. But if you are simply going to re-state your original incorrect point, then I can't help you any more. |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 24 12:23AM On Sat, 23 Feb 2019 15:09:58 -0800 (PST) > > } > the data race goes away if i change it to store(release) and load > (acquire) or SC on both, correct? Yes, but it is best to avoid using an acquire operation on the flag itself if spinning, to avoid a fence instruction being emitted on each iteration of the while loop. This would do what you want: std::atomic<bool> flag{false}; bool data{false}; std::thread t1([&]() { data = true; std::atomic_thread_fence(std::memory_order_release); flag.store(true, std::memory_order_relaxed); }); std::thread t2([&]() { while(!flag.load(std::memory_order_relaxed)); std::atomic_thread_fence(std::memory_order_acquire); cout << "data = " << boolalpha << data << endl; }); t1.join(); t2.join(); return 0; |
"Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com>: Feb 23 08:25PM -0800 On 2/23/2019 4:23 PM, Chris Vine wrote: > t1.join(); > t2.join(); > return 0; :^D Using standalone fences is my habit of choice. You sort if intermingled it here but nice nonetheless: https://groups.google.com/d/topic/lock-free/A1nzcMBGRzU/discussion |
"Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com>: Feb 23 08:39PM -0800 On 2/23/2019 8:25 PM, Chris M. Thomasson wrote: >>>> Is it possible for this simple program to print false? Given the >>> compiler or CPU can reorder around the relaxed atomic. Or is my >>> understanding off. [...] > Using standalone fences is my habit of choice. You sort if intermingled > it here but nice nonetheless: > https://groups.google.com/d/topic/lock-free/A1nzcMBGRzU/discussion Fwiw, programming on the SPARC basically got me on this. Wrt my comment about intermingling, I accidentally read your release barrier as being part of the atomic itself, not standalone. Sorry for any confusion Chris. ;^o |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 24 11:05AM On Sat, 23 Feb 2019 20:39:09 -0800 "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> wrote: > about intermingling, I accidentally read your release barrier as being > part of the atomic itself, not standalone. Sorry for any confusion > Chris. ;^o As I read the standard[1] I think this "intermingling" works: std::atomic<bool> flag{false}; bool data{false}; std::thread t1([&]() { data = true; flag.store(true, std::memory_order_release); }); std::thread t2([&]() { while(!flag.load(std::memory_order_relaxed)); std::atomic_thread_fence(std::memory_order_acquire); cout << "data = " << boolalpha << data << endl; }); t1.join(); t2.join(); return 0; However, like you I don't do that because it looks a bit odd to me. [1] §29.8/4 of C++11 says "An atomic operation A that is a release operation on an atomic object M synchronizes with an acquire fence B if there exists some atomic operation X on M such that X is sequenced before B and reads the value written by A or a value written by any side effect in the release sequence headed by A." |
"Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com>: Feb 23 12:35PM -0800 On 2/23/2019 3:46 AM, Chris Vine wrote: > co-operating with more than one atomic variable where program action > does not depend on their modification ordering). Most algorithms can > be (re)written to void cases of sequential consistency. Dekker algorihtm basically needs seq_cst wrt its store followed by a load to another location. It needs an explicit MFENCE or dummy LOCK'ed atomic, even on x86. Well, there is the more exotic asymmetric version, but that uses another type of barrier that is not provided by C++11. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment