BitShares Forum

Main => Technical Support => Topic started by: XHC on March 31, 2014, 03:08:10 pm

Title: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: XHC on March 31, 2014, 03:08:10 pm
If I want to develop a new DAC.
Is there any guide or suggest?
Thanks!
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on March 31, 2014, 03:25:35 pm
If I want to develop a new DAC.
Is there any guide or suggest?
Thanks!

BitShares toolkit is under rapid development, we are putting together tutorials and examples. 
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: XHC on March 31, 2014, 03:32:49 pm
If I want to develop a new DAC.
Is there any guide or suggest?
Thanks!

BitShares toolkit is under rapid development, we are putting together tutorials and examples.
It sounds good. How soon will the tutorials and examples be released?  I'm eager.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on March 31, 2014, 04:19:02 pm
If I want to develop a new DAC.
Is there any guide or suggest?
Thanks!

BitShares toolkit is under rapid development, we are putting together tutorials and examples.
It sounds good. How soon will the tutorials and examples be released?  I'm eager.

Aren't we all!   I have to prepare for two speaking events, take a week to speak, and launch BitShares XT prior to getting this done....  in the mean time Toast & HackFisher are both learning from the code and the forum is available to answer questions.

There are many examples in the toolkit (dns,lotto,me,btsx,etc) that all extend the basic tools.   
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: toast on March 31, 2014, 04:34:40 pm
There are many "learning tasks" we could assign. If you are interested I will make github issues specifically for you
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: oco101 on March 31, 2014, 07:48:21 pm
There are many "learning tasks" we could assign. If you are interested I will make github issues specifically for you

Or maybe make a section of  "learning  tasks" for everybody who want's to learn instead just for a specific user ?
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: Talos on March 31, 2014, 09:29:13 pm
There are many "learning tasks" we could assign. If you are interested I will make github issues specifically for you

Or maybe make a section of  "learning  tasks" for everybody who want's to learn instead just for a specific user ?
Please count me in too. Interested and keen to learn more.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: XHC on April 01, 2014, 01:32:16 am
There are many "learning tasks" we could assign. If you are interested I will make github issues specifically for you
I am really interested. But I'm a little confused, you mean you will assign specific learning task to me or something else?
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: toast on April 01, 2014, 01:36:39 am
I guess I'll just start putting things up as issue on github for anyone to do. There should be a lot more once we get people testing with an alpha client
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: XHC on April 01, 2014, 01:41:56 am
I guess I'll just start putting things up as issue on github for anyone to do. There should be a lot more once we get people testing with an alpha client
Thanks. Hope that would be helpful.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: John-S on April 18, 2014, 02:36:27 am
I'm a noob myself, but have learned a lot in the past couple of days.  Message me with your specific questions and I'll see what I can't do to help bootstrap you along.

- John "S"
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 18, 2014, 05:10:58 am
I'm a noob myself, but have learned a lot in the past couple of days.  Message me with your specific questions and I'll see what I can't do to help bootstrap you along.

- John "S"

Post questions here and I can double check understanding and future devs can see the questions/answers as well.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: vikram on April 18, 2014, 06:32:56 am
I'm a noob myself, but have learned a lot in the past couple of days.  Message me with your specific questions and I'll see what I can't do to help bootstrap you along.

- John "S"

Post questions here and I can double check understanding and future devs can see the questions/answers as well.

Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: John-S on April 18, 2014, 03:59:15 pm
The concept you mention that's used with wallet, is often referred to as the PIMPL pattern (private implementation). 

I first came to appreciate the power of the paradigm when first stumbled on to QT3, and to this day I still point to the QT code base as how to do it right.

Essentially, it allows you to define a class interface that can remain constant while the implementation can be changed without affecting either the binary or the logical interface (dependencies, etc).    Its a beautiful way to encapsulate dependencies and simplify the use of a class library.  And unlike the notion of "private" in a class definition, what you do in the implementation class can be considered truly private.

QT uses this to great effect such that each shared library that implements a class interface, never changes for the life span of a major version release, while the internals, the implementation details can be updated without requiring the users of the libraries to have to recompile and relink.

Even when not building a binary library, I still use this paradigm to provide true isolation between my implementation and the users of a class library.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 18, 2014, 04:19:45 pm

The concept you mention that's used with wallet, is often referred to as the PIMPL pattern (private implementation). 

I first came to appreciate the power of the paradigm when first stumbled on to QT3, and to this day I still point to the QT code base as how to do it right.

Essentially, it allows you to define a class interface that can remain constant while the implementation can be changed without affecting either the binary or the logical interface (dependencies, etc).    Its a beautiful way to encapsulate dependencies and simplify the use of a class library.  And unlike the notion of "private" in a class definition, what you do in the implementation class can be considered truly private.

QT uses this to great effect such that each shared library that implements a class interface, never changes for the life span of a major version release, while the internals, the implementation details can be updated without requiring the users of the libraries to have to recompile and relink.

Even when not building a binary library, I still use this paradigm to provide true isolation between my implementation and the users of a class library.

So nice to see another developer that gets it!!!


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 18, 2014, 04:26:46 pm
It accelerates compile times as well because it removes need to include headers in your headers that is only required for private data. 


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 18, 2014, 04:28:34 pm
Asset is an amount plus unit. 

Precision problems have been resolved by changing verification algo.


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: vikram on April 22, 2014, 03:57:49 am
What do the FC_REFLECT* macros enable you to do in the rest of the fc library?
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 22, 2014, 11:57:29 am
Serialized to json and binary, works with exception and logging infrastructure.

Eventually scripting language hooks etc. 


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: vikram on April 22, 2014, 10:30:28 pm
How do you envision the codebase being organized to enable easily developing and maintaining multiple DACs per family? Specifically, I am considering whether it is feasible and desirable to separate BTS/DNS/P2P specific code into a BTS::DNS::P2P namespace which overrides the relevant stubs in BTS::DNS (additional DNS family members would then follow the same pattern).
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 22, 2014, 10:54:50 pm
How do you envision the codebase being organized to enable easily developing and maintaining multiple DACs per family? Specifically, I am considering whether it is feasible and desirable to separate BTS/DNS/P2P specific code into a BTS::DNS::P2P namespace which overrides the relevant stubs in BTS::DNS (additional DNS family members would then follow the same pattern).

The difference between P2P and .dac etc should be config-file based and not code based. 

The only time I would derive from DNS is if I was going to change the rules from the base DNS system.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: toast on April 22, 2014, 11:03:33 pm
But all non .p2p blockchains will have different rulesets (at least the ones we make)

Sent from my SCH-I535 using Tapatalk

Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: bytemaster on April 23, 2014, 12:23:22 am
But all non .p2p blockchains will have different rulesets (at least the ones we make)

Sent from my SCH-I535 using Tapatalk

Not true.   You could have many different namespaces each with the same rules.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: toast on April 23, 2014, 12:35:02 am
You *could* but that would be ignoring the philosophy we endorsed after the discussion about the role of TLDs we had in the DNS section. Even if there are multiple TLDs with the same rules vikram's question still has merit because we specifically want to have other blockchains with other rulesets.
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: crazybit on May 10, 2014, 03:48:19 am
Obviously,FC is the fundamental library of bitshare toolkit.  i would like to have an in-depth study, but do not know how/where to start, is there any documentation i can refer to? attached below are some of my questions, appreciated if anyone help to clarify.

1) there is some following code under the data object,what is the purpose? how it work?and when such code will be executed?
Code: [Select]
FC_REFLECT(..)
2)there are many multiple thread program like below in bitshare toolkit, i  don't quit understand how it work.

Code: [Select]
my->....complete = fc::async( [=](){ my->process..(); } );
3)Serialization is also frequently used in the toolkit,what data format are the following functions convert to? and where are the data saved after the serialization?any difference of the data format between the following serialization functions

Code: [Select]
fc::raw::pack( ...); 

pub.serialize();
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: vikram on May 10, 2014, 06:52:10 pm
Until Dan chimes in, there is some sparse documentation at: http://bitshares.org/documentation/namespacefc.html
Title: Re: How to learn the bitshares_toolkit framework quickly for a newbie?
Post by: Count of La Mancha on May 10, 2014, 07:34:49 pm
Obviously,FC is the fundamental library of bitshare toolkit.  i would like to have an in-depth study, but do not know how/where to start, is there any documentation i can refer to? attached below are some of my questions, appreciated if anyone help to clarify.

1) there is some following code under the data object,what is the purpose? how it work?and when such code will be executed?
Code: [Select]
FC_REFLECT(..)
2)there are many multiple thread program like below in bitshare toolkit, i  don't quit understand how it work.

Code: [Select]
my->....complete = fc::async( [=](){ my->process..(); } );
3)Serialization is also frequently used in the toolkit,what data format are the following functions convert to? and where are the data saved after the serialization?any difference of the data format between the following serialization functions

Code: [Select]
fc::raw::pack( ...); 

pub.serialize();

I am reviewing the code for the community and can shed some light on these questions based upon my observations.

Obviously,FC is the fundamental library of bitshare toolkit.  i would like to have an in-depth study, but do not know how/where to start, is there any documentation i can refer to? attached below are some of my questions, appreciated if anyone help to clarify.
1) there is some following code under the data object,what is the purpose? how it work?and when such code will be executed?
Code: [Select]
FC_REFLECT(..)

FC_REFLECT is a macro that expands into a template specialization that calls a method for each member.  It seems to enable the creation of different kinds of serialization techniques.   The two primary uses seems to be for what he calls 'raw' and 'json'.   raw appears to be just a binary representation and json is self explanatory.

Quote
2)there are many multiple thread program like below in bitshare toolkit, i  don't quit understand how it work.

Code: [Select]
my->....complete = fc::async( [=](){ my->process..(); } );

This code is actually cooperative multi-tasking and the fc library provides a scheduler that will manage the execution of multiple fibers in a single thread.  This is a very useful construct because you do not have to worry about context switching at arbitrary points like you do with multi-threading.   On the other hand if a fiber blocks without yielding the other tasks in the same thread will not get executed.     fc::async() dispatches a task to be run on the current thread the next time it yields.