繁体   English   中英

有哪些理论和/或实验编程语言功能?

[英]What theoretical and/or experimental programming-language features are there?

我正在设计一种编程语言,纯粹是为了好玩,并希望尽可能多地添加实验性功能,只是为了使编程完全不同,并且不像Brainf * ck或Malbolge那样糟糕。

然而,我似乎很难为它提出新的东西,但我确信那里有很多东西已被讨论但从未真正尝试过。

  • 目前还没有在主流语言中实现哪些实验性语言功能或概念?

例如:如果我问这个问题,让我们说,1960年,答案可能是“面向对象编程”。

我确信计算机科学家(最近)提出了很多未实现的想法,至少我被告知过。

目前的一个研究领域是依赖类型 你还可以做很多事情,但还没有完成。

DWIMNWIS(做我的意思,不是我说的)。

更严重的是,一个非常棒的功能(实现起来非常难以实现)将是一种语言程序能够证明不包含并发性问题的能力。

至于MUST-HAVE的功能,我会说lambdasFirst-class功能 不完全是新的或理论上的(今年Lisp有多大)但是很多语言都很强大和缺失。

阅读ACM和IEEE出版物以获取研究思路

这是一个想法; 如果有人写它,他们必须给我版权信用! 自动内置任意矩阵模板,使得这些矩阵不是数学类型,而是更多的存储或结构类型。 根据模板参数,如果计算机可以允许它而不会耗尽内存,这些矩阵可以像标量值一样简单,也可以像理论上的近无限维实体一样复杂,但实际上这仅限于体系结构,操作系统和编译器整数或整数类型的内在细节。 因此,可以有一个低维体积矩阵,即3维,但内存不足,因为它可能如下所示: Matrix<type, 1000000000,1000000000,1000000000> matOutOfBounds在更高维度矩阵之前,如Matrix<type, 2,2,2,2,2,2,2,2>是一个8D体积矩阵。 如果它们是“完美的矩阵”,则可以进行简化。 这就是每个维度具有相同精确数量的元素,无论它们具有多少维度。 例如: <3,3> <3,3,3> <3,3,3,3>都是完美的矩阵。 简化为Matrix<type, 4^4>Matrix<type, 4,4,4,4> Matrix<type, 4^4>相同Matrix<type, 4,4,4,4>得到4x4x4x4 4D体积矩阵,在4D结构中有96个元素。 其中`Matrix将是3D体积矩阵,具有许多元素,但具有3D体积结构,因为我们当前的时钟和罗盘以360度到整圆,60分钟,60秒的速度运行,除了有许多浮动存储元素。

下面的内容现在看起来像某人可能会在其项目中包含的C ++库; 但这里的想法是使它成为内置语言类型。 然后任何一个使用您的语言和编译器的人都可以随意使用它们。 他们可以使用任何数量的维度,例如此模板描述的内容:

// Header Declaration
template<typename ClassType, unsigned int...>
matrix{
}; // No need to show body just declaration for concept

// User Code Would Be
matrix<float,2,3,4,5,7> mat; // This would create a 2x3x4x5x7 matrix that is a 5th dimensional volumetric matrix

// Default type
matrix<int> mat2; // This creates a 1x1 matrix that would in essence be a scalar.

现在我展示的是可变参数模板的当前c ++语法。 这里的想法是这些矩阵容器将以类型构建!

想让它们成为数学家吗? 当然没关系,但用户必须定义​​自己的“算法,方法,函数或例程”才能这样做。

他们必须独立定义的原因是这样做的:

mat<float, 3,3,3> mat1; 3x3x3  3D Volumetric Matrix  -    27 elements
mat<float,   5,5> mat2;   5x5  2D Linear-Quadratic (Area) Matrix -  25 elements
mat<int,   6,7,8> mat3; 6x7x8  3D Volumetric Matrix -    336 elements

mat<bool, 8>      mat4;   1x8  1D Linear Matrix (Array); transpose?
                  mat4::transpose; // built in - now 8x1 matrix
                  mat4::transpose; // back to 1x8.

class TheMotherLoad {// Many members and methods };
// ...
mat<TheMotherLoad*, 9,9,9,9,9,9,9,9,9> mat9;
// simplified version
mat<TheMotherLoad*, 9^9> mat9
// A 9 Dimensional Volumetric container So the first the would be a Cube
// with its sides having a length of 9 cells where the Volume 9^3 is the 
// First Order of what a Volumetric Matrix is.  
// Anything less is linear or quadratic either it being a scalar, 
// translation, an array, a line, a point, a vector, rotation, quadratic and area )
// Now that we have a cube that has 729 elements and the next 
// three 9s which are the 4th, 5th & 6th dimensions would act as another
// 9x9x9 matrix surrounding the first 3 dimensions respectively. 
// Finally the 7th, 8th & 9th dimensions defines the "outer matrix" 
// that also has "9x9x9" elements. So in total the number of elements 
// in this matrix would be 729^3 and for every 

由于矩阵的属性决定了可以对它们进行的数学运算的类型,因此必须从外部完成。

非顺序的(来自数据流编程的想法),以便在满足其依赖性时评估表达式。 以便:

print(msg)
msg = "Hello World" 

是一个有效的计划。 所有变量都类似于电子表格中的单元格。

    print i
    range(1..100) => i
    # prints 1 to 100

研究这种范式的变化传播属性的含义将是有趣的。 然而,设计这样的语言是一个巨大的挑战,当考虑条件,迭代等以及可能出现的同步问题时,它开始变得混乱。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM