language-design
heap handling in a bison push pure parser
Is there any w开发者_Python百科ay to specify my own allocator/deallocator functions for heap management instead of malloc()/free() for a pure push parser in bison?Most of Bison\'s memory allocations c[详细]
2023-02-19 04:09 分类:问答Could a language be designed that does not require the escaping of quotes in string literals?
In C++ (and, after translation, most languages) the following is of course a syntax error: std::string str = \"Hello \"Jesus\"\"; // oopsquotes[详细]
2023-02-18 22:07 分类:问答Why support comparison between different data types based on (seemingly) arbitrary rules?
My questions is, \"Why would a language designer consider allowing comparison between different data types?\". Also, does t开发者_Go百科his make more sense in a functional language?[详细]
2023-02-18 07:12 分类:问答What features are desirable for a programming language? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2023-02-18 00:55 分类:问答Generating intermediate code in a compiler. Is an AST or parse tree always necessary when dealing with conditionals?
I\'m taking a compiler-design class where we have to implement our own compiler (using flex and bison). I have had experience in parsing (writing EBNF\'s and recursive-descent parsers), but this is my[详细]
2023-02-17 23:41 分类:问答Is there a better way than 'iif' or '?:' for this kind of choosing?
I\'m at a point in my custom view engine that I want things to be a bit cleaner. One of the ugliest parts I have so far is iif type functionality. It ends up looking like this:[详细]
2023-02-17 20:46 分类:问答Interesting examples of Domain Specific Languages
I\'m considering doing something with Domain Specific Languages for my undergraduate project. My one problem is I can\'t really find any interesting examples that I can root around in. Does anyone hav[详细]
2023-02-17 20:18 分类:问答Why does the power operator in F# only work for floating point numbers?
I have never seen a language have exponent or power operator only taking floating point numbers? For example:[详细]
2023-02-17 03:10 分类:问答Would it be wrong if "file_exists" was designed to return a path instead of TRUE?
The file_exists function returns TRUE on success but I think it woul开发者_如何学运维d be more useful if instead of just TRUE, it returned the value of the passed $filename. Am I wrong to think that?[详细]
2023-02-15 19:38 分类:问答When can you claim your program is a "compiler"?
Accorging to wikipedia A compiler is a computer program (or set of programs) that transfo开发者_如何学Gorms source code written in a programming language (the source language) into another computer[详细]
2023-02-14 18:02 分类:问答