Comments (1)
首先强弱类型界定比较模糊。参考知乎这个问题 弱类型、强类型、动态类型、静态类型语言的区别是什么?
应该说除去汇编,都会有类型这个概念吧
至于为啥我会说某些部分是弱类型呢= =
因为LessTyping
的类型转换可以在运行时完成,并且依据不仅仅是原始类型和目标类型,还会考虑对象的状态(例如lt.lang.Lang.castToBool
)
只不过设计时尽量限制了隐式类型转换,比如字面量不允许过分的转换(例如不允许1 as bool
,但是a=1 \n a as bool
就可以),再比如只有小部分情况会考虑对象状态,大部分还是只考虑类型。毕竟像某些语言的_字符串自动变成数字_有时候还是挺让人困扰的。
至于LessTyping
的类型系统嘛,大概就是groovy
的感觉吧。为了和java互通不得不提供静态类型,比如要重写方法就必须有方法签名。
至于怎么设计更加合理嘛。。希望能多多提出建议哦~
毕竟第一次设计语言,只能做出最适合我自己的,但是否最合理就得靠时间磨合并修改了 : )
from latte-lang.
Related Issues (3)
- 编译源码时有些测试错误 HOT 5
- 大佬这个语言还在更新吗 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latte-lang.