Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror

Comment: Re:No disrespect to GCC, but why not LLVM? (Score 1) 77

by abies (#49535401) Attached to: GCC 5.1 Released

I know - this is why it was taking me 2-3 days to find a 100% reproducible bug (at least before I added debug printfs...). I just could not believe the gcc might be at fault.
Now, to be completely honest, first bug was present only on SPARC cpu on Solaris, x64 AMD was fine. We had to use gcc because one of libraries we were using was based on stlport compiled with gcc, so CC was out of question. I suppose that SPARC backend of gcc get a lot less testing. But second one on vanilla x64 intel linux and is still happening (gcc 4.8.2, but I think it was also checked to happen with 4.8.3). Magic option to avoid bug is -fno-tree-dse, whatever this means.

But yes, I was just unlucky - I have no doubts that gcc works fine for thousands programs out there. Guess what - it also works fine for both programs I have done, AFTER finding magic reordering of lines or command line option to get them to work. Who knows how many strange options are lurking in some of popular programs to work around similar issues ;)

Comment: Re:No disrespect to GCC, but why not LLVM? (Score 3, Interesting) 77

by abies (#49534923) Attached to: GCC 5.1 Released

GCC is the old, very reliable and well-known workhorse, that produces good results.

I'm mostly working with java and python, but I had two non-trivial encounters with gcc in past 10 years. In both cases C++ code was written by experts with me being just slightly involved.

In both cases I have hit gcc bugs which resulted in very wrong behaviour. Both times I have spent 2-3 days trying to find any reasonable explanations, ended up doing assembly dump of generated code and finding a place where gcc was generating plain wrong opcodes. In one case it was shift +or of two 32-bits to make a 64-bit number which sometimes was not loading one of registers from the stack, in second case conditional jump where condition was not set properly on second and further loops. Best part of first one was that it was working as long as there was any printf in same function (even 20 lines further down the method) - but as soon as we commented our debugging printf it was back to crashing.

Solution to first problem was to reorganize method randomly till it started compiling properly with same random useless local variables. Solution to second was to do some kind of -no-whatever flag, which we have found of by bisection by recompiling over and over with all the combinations of flags.

In both cases 'experts' were saying - no chance gcc can make such basic mistakes, you are looking in wrong place, I don't want to look at assembly dump, you are not supposed to second guess the compiler, linux kernel is using gcc so it is good, etc etc.

Yes, I probably just have bad luck. But I just don't accept 'reliable and good results', being burned 2 out of 2 attempts to use gcc in commercial work.

Comment: Re:4x strategy when? (Score 1) 58

by abies (#49509553) Attached to: Computer Beats Humans At Arimaa

I don't think it is THAT complicated. You don't really have hundreds of options each time - you have probably 10-20 options or so like 'explore', 'invest in infrastructure', 'build up military', 'attack players', etc. For each of these goals, you might need to do number of small actions - but I don't think this part is hard for computers. Given goal of 'churn out best miliary units in 5 turns', computer should be always able to come up with optimal set of moves.
Now, moving between these higher level goals is certainly non trivial. But these are longer term decisions (few turns probably), so I don't think that decision tree explodes that much - if you keep micromanagement and high level goals separate.
With chess, separating overarching goals from low level movements is a lot harder, as every move influences a lot more aspects of play and a lot of choices are effectively forced on both sides when you go down certain path. When you want to improve your city by building farms with no enemy units in close range, it really doesn't matter which of grasslands you go to first. I'm quite sure that most players play these things on 'auto' anyway.

I'm not trying to say that AI in cmputer games is easy. I'm just saying that trivially multiplying all possible choice of inputs by length of game and comparing that number to chess is not really fair.

Comment: Re:They're called trees. (Score 4, Informative) 128

by abies (#49493749) Attached to: Breakthrough In Artificial Photosynthesis Captures CO2 In Acetate

Europe and Asia (where the former has few forests left [...]

http://en.wikipedia.org/wiki/L...
Canada and the United States 26%
European Union 35%

And from
http://wdi.worldbank.org/table...
Europe it was 36.5% in 200 and 37.9% in 2012.

Not sure how good these statistics are, because it says 'Canada &United States = 26%' and then 'Canada =31%' and 'USA= 30.84%'... In any case, Europe has more forest area atm and amount of forest is growing rather than decreasing.

Or did you mean Europe has few forests left compared to situation from 2000 years ago? I can agree with that, but I don't think that global warming is THAT old - we used to have some mini ice age in meantime I think...

Comment: 4 types of immortality (Score 0) 313

One of the TED talks was covering this subject - it was really a kind of eye opener for me
https://www.ted.com/talks/step...
Presenter argues that there are 4 basic stories about immortality, which get repeated across the ages, with slightly different color, but same underlying idea - and realizing that helps to put some distance into believing latest 'science magic'
1) Elixir - immortality of the body (Philospher Stone, Fountain of Youth, hormone teraphy, gene telomere therapy etc)
2) Ressurection - getting raised from dead (bible Apocalypse raise-from-dead at end of times if you are buried properly, being ressurected from cryogenic sleep by future scientists if frozen properly)
3) Soul - preserving mind/person even if body is gone (most religions afterlife/reincarnation, mind upload)
4) Legacy - preserving your ideas and/or genetics (having children, rising/teaching children, creating works of art, science discoveries, blowing yourself up to good of your village/country/religion etc)

In this case, parents just wanted to believe their 'scientific' version of ressurection fairy story. It is just more expensive and slightly more gruesome than lot more common rite of putting body into ground with priest chanting over it, so it can get ressurected by allmighty God at end of time. As long as child was properly circumcised in time. Or baptized. Or hasn't killed any puppy. Or was frozen to exactly proper temperature with right mix of chemicals.

Comment: UK solution (Score 3, Interesting) 143

by abies (#49461543) Attached to: Spain's Hologram Protest: Thousands Join Virtual March In Madrid

Few years ago, when teachers were protesting against low wages in UK, protest was routed through biggest commercial street in London (Oxford Street). Before it has reached the end, half of the people protesting was gone, shopping (they came from all over UK, so being able to visit all the shops, both discounts and posh ones was a real treat).

Comment: Re:Only correlation has been established. (Score 1) 97

by abies (#49452983) Attached to: Being Overweight Reduces Dementia Risk

Only if you define 'ideal weight' as one which reduces mortality by highest margin. If there would be a way to guarantee 200 years of body life by putting person in pharma coma for all that time, would it be 'ideal state' to go through live?

Mortality quality of life. Probably a lot of people will trade extra 1% of chance dying few years earlier, for 80% of having 10 last years of life bearable instead of being bed-bound.

Now, I'm not saying that being slight overweight neccesarily decreases quality of life (looking at what my weight-aware friends are eating I'm quite sure of opposite) or will make you a cripple. Just want to point out that there are more things to take into account that pure statistical mortality.

Comment: Re:Why empathize that it's Java? (Score 3, Interesting) 61

by abies (#49408869) Attached to: BioWare Announces Open-Source Orbit Project

You can call java from other environments, it is just not trivial - and you will need spawn parts of jvm inside your process.

It is also not trivial to call into C++ library which uses a lot of STL goodness in its API from some of languages. Basically, it is just plain C which got very good and easy compatibility in every language out there - and you end up with a lot of C++ libraries doing poor-man extern "C" interfaces just to make compatibility easier.

But the real answer I think is - nobody wants to. If you have your golden framework in java, there is nothing forcing you to endure C++ anymore ;)

Comment: Re:What's glibc? (Score 1) 60

by abies (#49405929) Attached to: Valve Bootstrapped Source 2 Engine On an Open-Source Vulkan Driver

Nothing yet, because Vulkan is not yet public, so no 'free' implementations exist. But I'm quite sure that as soon as it appears, projects like Ogre3D or openscenegraph will provide their bindings over Vulkan.

This analogy is flawed in some respect - because glibc is a drop in replacement for libc. There is no such agreement on higher level API in this case, but rather competing APIs/engines.

Comment: Re:No thanks (Score 1) 60

by abies (#49403827) Attached to: Valve Bootstrapped Source 2 Engine On an Open-Source Vulkan Driver

It doesn't meant that code to render million triangles will have 600 million lines. It is just a constant overhead to deal with various device trickery (multiple GPUs, multiple monitors, full screen versus window, etc etc). There will be 3rd party libraries immediately which will allow you to do 'render things on default screen, with default resolution, on default graphic card, not using SLI, using default malloc for memory allocation' with single function call, reducing line count drastically (but still probably considerably larger than 5-10 lines you would need in opengl). On the good side, as soon as you start creating parameterized shaders, instanced meshes etc, difference in line count will start to be neglible - it will be huge for both Vulkan and plain opengl/DirectX.
And it is still too much, then download Unity, Unreal or Cryengine. Especially Unreal should be good - you can program there with drag&drop (http://cybereality.com/wp-content/uploads/2015/02/UE4_Pong_BP.jpg)

Vulkan is API for game engine programmers, not for game developers. It is a lot closer to kernel API than to libc API if you want to compare with normal programming.

Comment: Re:Github is scary for critical code (Score 2) 116

Technically, it is not China itself which is DDOSing them, but all the people from _outside_ of china which are accessing Baidu servers in China. Basically some part of chinese disapora is DDOSing github. Which is considerably smaller number of people than 'China'.
Plus, it is happening just on browser refresh, not as dedicated trojan running heavy DOS attack from each PC.

As of next Tuesday, C will be flushed in favor of COBOL. Please update your programs.

Working...