Git Product home page Git Product logo

Comments (11)

vczh avatar vczh commented on September 27, 2024

你可以关心一下Release repo的todo.md,现在文档还在写,写完你就明白了。

简单来说,这个库的基础部分在我还没大学毕业的时候就开始了,那个时候的标准库就是一坨屎。写到今天标准库仍然还有一些东西没有完成,譬如说带高级capture的regex,譬如说localization,譬如说linq(还在标准里没拉出来),譬如说让前面所有的这些东西支持运行时反射(虽然你用不到,但是GacGen.exe需要用到)。所以这就是为什么我干脆重新来了一遍。

脚本的话,你可以理解为就是把C++改成了容易理解的样子,骨子里还是引用计数,基本观点跟COM差不多。脚本经过GacGen.exe编译之后完全被重写成了C++,可以摆脱所有对反射的依赖,直接用javascript和lua没办法做到这一点。当然你愿意自己写一个javascript到C++的编译器的话,随时可以来PR(逃。

反射占据的体积很大,如果运行时不能不依赖反射的话,现在2M的exe就得爆炸到20M,还要让加载变慢。这就是为什么我做出了那个脚本的决定。

from gacui.

jadedrip avatar jadedrip commented on September 27, 2024

了解了,不过现在是 C++ 17 的时代了,标准库也稳定了,建议还是尽量用标准库吧,一个新库降低学习成本还是很重要的,这样可以让更多人来使用。
现在就等教程了,追)

from gacui.

FirstLoveLife avatar FirstLoveLife commented on September 27, 2024

标准库也稳定了

Not yet. Many c++11 stuffs have been deprecated in 17/20

from gacui.

jxd134 avatar jxd134 commented on September 27, 2024

@FirstLoveLife
有哪些c++特性在17/20废弃了呢。
就我所知,有std::shared_ptr的接口

from gacui.

FirstLoveLife avatar FirstLoveLife commented on September 27, 2024

17: P0174R2
2a: AFAIK, no paper to introduce yet, the most recent(today) removed feature I met is result_of. Besides, changed a lot. stl has a talk about this library on cppcon

from gacui.

vczh avatar vczh commented on September 27, 2024

降低学习成本是好的,但是我并不相信使用标准库就能降低学习成本,因为这么多年来标准库就是没有人用的。反而我根据大多数其他语言的习惯造出来的Vlpp,大家接受起来会更容易一点。因为就只有C++跟别人不一样。事实上几个跟我接触的“相对重度用户”也是这么说的。

from gacui.

jadedrip avatar jadedrip commented on September 27, 2024

哦,我说的是两件事,用标准库的意思,是减少重复的轮子,以便集中精力做更重要的东东。
第二件事是建议用 lua, javascript 之类的知名脚本,而不是重新做一个,以降低别人的学习成本。
其实包括你的 xml 定义也是自己重新做的吧,在没有成熟编辑器的情况下,学习成本也会很高。

也就是个建议而已。

from gacui.

vczh avatar vczh commented on September 27, 2024

@jadedrip 还行,反正我也没找到什么靠谱的js和lua到C++的编译器,而且这些语言的逻辑是自带垃圾收集的,不合适。我需要的是一门没有垃圾收集的脚本。一开始我认为应该是Basic,但是Basic也是太多分支了。

from gacui.

sekkit avatar sekkit commented on September 27, 2024

本来想提一个python/C# binding的issue,但是要求把脚本翻译成c++。为什么不仅仅导出api给脚本调用,用户的业务逻辑可以在纯脚本层 这样更符合大众的习惯。
提这个问题可能理解不到位。
目前一些支持脚本的小gui库挺多人用,且支持热更新

from gacui.

vczh avatar vczh commented on September 27, 2024

@sekkit 一般来说,脚本做的GUI程序不需要有酷炫的特效,因此他们不需要使用C++代码来操作具体的控件,只要结合MVVM、data binding和少量的xml里面的脚本代码就可以了。我建议如下操作:

  • 还是用原来的办法用XML写GUI
  • 把XML编译成C++
  • 用脚本来实现view model,然后反向bind进这个C++项目里。这个以后可以写一些codegen来做,你有兴趣也可以试试看(逃
  • 编译一下就得到用XML、workflow和你喜爱的脚本语言写的GUI程序了

from gacui.

MouriNaruto avatar MouriNaruto commented on September 27, 2024

既然提到 Basic,不知道 @vczh 是否用过 FreeBasic
近十年前,我还是初中生的时候,听说了这个有 include 且自举的 Basic 工具集

from gacui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.