OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

C++11 for next stable release of OpenSceneGraph?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11924

PostPosted: Mon Jun 11, 2018 6:58 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Hi All,

My current focus is on the VulkanSceneGraph, exploring C+11, Vulkan
and new ideas of what a next gen scene graph should look like.
OpenSceneGraph is still very much my baby though. Stuff that is
working well on the VulkanSceneGraph could serve as a model for what
we can do to elements of the OpenSceneGraph, so potentially as
advances are made in VulkanSceneGraph would could refactor the
OpenSceneGraph to take advantage of similar approaches.

While OpenSceneGraph will remain focused on OpenGL and aim to retain
good backwards compatibility there may be opportunities to make life
easier to OpenSceneGraph users. One of these areas is taking
advantage of some of the features that C++11 has to offer. So far on
the VulkanSceneGraph side I've experimented with some low level
equivalents of things like ref counting, ref pointers, observer
pointers taking advantage of C++11 and it's a delight, the code is
SOOOO much simpler and cleaner that what's presently in the
OpenSceneGraph.

So I'd like to put out the topic for discussion about whether we could
set the min compiler version of the OpenSceneGraph to C++11 for the
next major stable release. I don't have any specific plans to this
next stable release, I'm assuming it'll be 4.0, it'll likely be
another year or so before being released. I would like to this
OpenSceneGraph stable release to sync in a bit with the
VulkanSceneGraph efforts but as this project is just beginning the
schedule for it's own releases is completely open. When I say sync a
bit, I'm really just referring to taking opportunities to cross
pollinate ideas a bit, make co-existance of the two projects easier,
what that will mean in practice I absolutely can't say, it's really
just an aspiration right now.

Back to C++11, the pros of adopting it for OpenSceneGraph-4.0 is that
we could simplify parts of the core OpenSceneGraph, making it both
easier to lean and maintain. Potentially even OpenThreads could be
removed as dependency and then from the core OpenSceneGraph and made
it's own separate project once again.

The cons of adopting C++ would be restrictions on just how old the
compilers can be to be used with OpenSceneGraph-4.x, so could limit
one aspect to backwards compatibility.

I would suggest that OpenSceneGraph-3.x series remain compilable
without needing C++11. So 3.6.x for instance we'll make bug fixes etc
but never change the compiler requirements.

Thoughts?
Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Alberto Luaces
Guest





PostPosted: Mon Jun 11, 2018 8:15 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Robert Osfield writes:

Quote:
I would suggest that OpenSceneGraph-3.x series remain compilable
without needing C++11. So 3.6.x for instance we'll make bug fixes etc
but never change the compiler requirements.

Having that fallback (3.x) for the tiny amount of systems that don't
support C++11 is a sensible approach, and I would even dare to say
extra-conservative, given the support of C+11 among current compilers.

--
Alberto



------------------
Post generated by Mail2Forum
Back to top
Chris Hanson
Guest





PostPosted: Mon Jun 11, 2018 4:19 pm    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

I'm totally in support of moving to C++11.





On Mon, Jun 11, 2018 at 2:14 AM Alberto Luaces < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Robert Osfield writes:

Quote:
I would suggest that OpenSceneGraph-3.x series remain compilable
without needing C++11.  So 3.6.x for instance we'll make bug fixes etc
but never change the compiler requirements.

Having that fallback (3.x) for the tiny amount of systems that don't
support C++11 is a sensible approach, and I would even dare to say
extra-conservative, given the support of C+11 among current compilers.

--
Alberto

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
bbjorn
Appreciator


Joined: 12 Oct 2010
Posts: 216
Location: Linköping, Sweden

PostPosted: Mon Jun 11, 2018 6:43 pm    Post subject:
Reply with quote

I am also in total support to move to C++11.

I am even inclined to favor moving all the way to C++17, which includes some nice features (my favorite being allowing initializers in if and switch statements). And even Visual Studio is somewhat conformant:
https://blogs.msdn.microsoft.com/vcblog/2018/05/07/announcing-msvc-conforms-to-the-c-standard/

Regards
Björn
Back to top
View user's profile Send private message Visit poster's website
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 814

PostPosted: Tue Jun 12, 2018 6:21 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Hi,

I totally support the step to use a more modern feature set of C++. It
really makes code easier to read, maintain and coding more fun. I'd
rather target C++14/17 though since almost all modern compilers are good
at keeping up with the new features (even Microsoft is doing a good job
here). If you consider this too much of a stretch, you might consider
to simply constrain the set of features allowed for now (excluding not
so well supported ones).

Another word on coding style: Lambdas, especially when the get more
complex should follow a consistent style. Else they tend to increase the
parsing effort for the human brain beyond most people's limit.

From my experience the should always be defined and named before use in
a function. This way the function of the lambda is stated by the name
which saves a lot of guesswork.

E.g.

//// the "auto" inside the lambda params is a C++14 feature btw.
auto find_name= [&token](const auto& elem){return token==elem.name;};

std::find_if(std::begin(elements), std::end(elements), find_name);

instead of:
std::find_if(std::begin(elements), std::end(elements), [&token](const
auto& elem){return token==elem.name;});


Cheers
Sebastian


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Daniel Trstenjak
Guest





PostPosted: Tue Jun 12, 2018 7:10 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Hi Sebastian,

Quote:
I'd rather target C++14/17 though since almost all modern compilers
are good at keeping up with the new features (even Microsoft is doing
a good job here).

you just have to consider that switching compilers isn't that easy for
everyone, because they've constraints that aren't completely under their
control.

So going for C++11 should be fine at this point in time, but I wouldn't
go beyond.

Greetings,
Daniel


------------------
Post generated by Mail2Forum
Back to top
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 814

PostPosted: Tue Jun 12, 2018 7:24 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Hi Daniel, > Hi Sebastian,
Quote:

Quote:
I'd rather target C++14/17 though since almost all modern compilers
are good at keeping up with the new features (even Microsoft is doing
a good job here).

you just have to consider that switching compilers isn't that easy for
everyone, because they've constraints that aren't completely under their
control.

But VSG is a fresh start and there are no existing projects that use it
a this point. So "switching" compilers is not an issue, right? I mean if
someone is planning on using it, using a modern compiler is simply a
prerequisite. Since the project just started I think it won't be used in
production before 2019. Until then most environments should be up2date
with C++14 conforming compilers.

Quote:

So going for C++11 should be fine at this point in time, but I wouldn't
go beyond.

Most C++11 compilers I've encountered support a subset of C++14 anyways,
which is why I also pointed out, that defining a set of features might
be possible too.


Cheers
Sebastian


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11924

PostPosted: Tue Jun 12, 2018 7:37 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

HI Guys,

Thanks for the feedback on adopting C++11 and later for the next
stable OpenSceneGraph release.

I am not planning on radical change to OSG in this timeframe, instead
where things will be cleaned up and it's an easy change to adopt
recent C++ functionality to achieve this. I don't foresee a general
walk through of the OSG codebase changing everything we can to a
modern C++ way of doing things just because it could be done.

FYI, prior to the 3.6.1 release I stepped through making sure it built
cleanly under C++11, 14 and 17, the only thing I had to amend was to
replace the deprecated C++ usage. This means that 3.6.1 is forwards
and backwards compatible to a wide range of C++ compilers.

For me, the key thing for the OpenSceneGraph project is now stability.
I want it to be a rock solid base for people to develop and maintain
their graphics application upon.

Cheers,
Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 814

PostPosted: Tue Jun 12, 2018 7:40 am    Post subject:
C++11 for next stable release of OpenSceneGraph?
Reply with quote

Hi Daniel,

Sorry I was mixing up VSG and OSG here. For OSG you're totally right
with your concerns.

Cheers
Sebastian > Hi Daniel, > Hi Sebastian,
Quote:
Quote:

Quote:
I'd rather target C++14/17 though since almost all modern compilers
are good at keeping up with the new features (even Microsoft is doing
a good job here).

you just have to consider that switching compilers isn't that easy for
everyone, because they've constraints that aren't completely under their
control.

But VSG is a fresh start and there are no existing projects that use it
a this point. So "switching" compilers is not an issue, right? I mean if
someone is planning on using it, using a modern compiler is simply a
prerequisite. Since the project just started I think it won't be used in
production before 2019. Until then most environments should be up2date
with C++14 conforming compilers.

Quote:

So going for C++11 should be fine at this point in time, but I wouldn't
go beyond.

Most C++11 compilers I've encountered support a subset of C++14 anyways,
which is why I also pointed out, that defining a set of features might
be possible too.


Cheers
Sebastian



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts OpenSceneGraph-3.6.2-rc1 tagged, plea... robertosfield General 4 Wed Jun 20, 2018 1:09 pm View latest post
No new posts Please test OpeSceneGraph-3.6 branch ... robertosfield General 0 Mon Jun 18, 2018 6:43 pm View latest post
No new posts OpenSceneGraph3.6.1 stable release ta... robertosfield General 0 Mon May 28, 2018 8:21 am View latest post
No new posts OpenSceneGraph-3.6.1 release candidate 7 robertosfield General 37 Fri May 25, 2018 11:30 am View latest post
No new posts OpenSceneGraph-3.6.1 release candidat... robertosfield General 4 Tue May 22, 2018 6:41 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP