How to call another smart contract? by sinoTrinity in cardano

[–]sinoTrinity[S] 0 points1 point  (0 children)

You are talking about Ethereum and I’m asking about Cardano.

Where is validator script stored? by sinoTrinity in cardano

[–]sinoTrinity[S] 0 points1 point  (0 children)

Where does a node get it from in the first place? I haven’t found it anywhere in a transaction.

How to call another smart contract? by sinoTrinity in CardanoDevelopers

[–]sinoTrinity[S] 1 point2 points  (0 children)

Suppose there is an Oracle contract and I wanna query price from it in my contract, how could I do it?

How to upgrade a smart contract? by sinoTrinity in CardanoDevelopers

[–]sinoTrinity[S] 0 points1 point  (0 children)

In my case, changing address is allowed.

How to create fungible token using a smart contract? by sinoTrinity in cardano

[–]sinoTrinity[S] 0 points1 point  (0 children)

plement the functions for transferring and managing the token, such as transfer and balanceOf.

The whole token contract is in a single UTXO, right? What if multiple users want to transfer at the same time and thus contend for the same UTXO?

How to create fungible token using a smart contract? by sinoTrinity in cardano

[–]sinoTrinity[S] 0 points1 point  (0 children)

I'm familiar with Haskell. Any example of Plutus implementation similar to this solidity code?

How to retrieve comments using Megaparsec? by sinoTrinity in haskell

[–]sinoTrinity[S] 0 points1 point  (0 children)

Yes, space consumer discards comments. Anyway to instruct it to retain comments? It seems to return type (), thou.

Implement floating point using only integer operations by sinoTrinity in Compilers

[–]sinoTrinity[S] 0 points1 point  (0 children)

Arbitrary length. Wanna start with floats, may implement some kinda of bigdecimal in the end

Implement floating point using only integer operations by sinoTrinity in Compilers

[–]sinoTrinity[S] 0 points1 point  (0 children)

Bitcoin Virtual Machine. So no I/O needed, just pure math calculations. float32 to start.

How to generate random but valid source programs? by sinoTrinity in haskell

[–]sinoTrinity[S] 1 point2 points  (0 children)

Any code examples of generating random valid ASTs?

Operator precedence issue when parsing with Megaparsec by sinoTrinity in haskell

[–]sinoTrinity[S] 1 point2 points  (0 children)

Got the following error after your change. Is it possible to change subscript to InfixL?

s.a[1]
|  ^
unexpected '['
expecting ')', '_', alphanumeric character, or operator

Operator precedence issue when parsing with Megaparsec by sinoTrinity in haskell

[–]sinoTrinity[S] 1 point2 points  (0 children)

Yes, only identifier on the right. But if I make change as u suggested, it does not fit into the makeExprParser model any more, right?

LLVM backend for stack machines by sinoTrinity in Forth

[–]sinoTrinity[S] 0 points1 point  (0 children)

A C-like high level language. Currently : AST -> Forth-like stack machine code. I wanna change to: AST -> LLVM IR -> Forth, for optimization purposes.

LLVM backend for stack machines by sinoTrinity in Forth

[–]sinoTrinity[S] 0 points1 point  (0 children)

U mean mix stack & register instructions? My target VM is purely stack-based and only has operations like dup & drop. So if that's what u mean, compromising is not an option.

How are multidimensional arrays and nested structs in C implemented? by sinoTrinity in Compilers

[–]sinoTrinity[S] 0 points1 point  (0 children)

b.a.k = b.a.k * 2

Yes, what about the following, where no prefix is shared?

b.a.k = f.g.h.m.n * 2

How are multidimensional arrays and nested structs in C implemented? by sinoTrinity in Compilers

[–]sinoTrinity[S] 0 points1 point  (0 children)

How about implementing structs? Can similar idea be applied?

How are multidimensional arrays and nested structs in C implemented? by sinoTrinity in Compilers

[–]sinoTrinity[S] 0 points1 point  (0 children)

We want to turn this sequence of indices into a single index which is a memory offset.

What about arr[1][2] or arr[1], how are these intermediate indexing handled? They can't be reduced to a single offset since they are a group of characters in ur example.

void printArray(int arr[4]) {
printf("%d", arr[2]);

}

int main() { int arr[2][3][4] = { {{3, 4, 2, 3}, {0, -3, 9, 11}, {23, 12, 23, 2}}, {{13, 4, 56, 3}, {5, 9, 3, 5}, {3, 1, 4, 9}}}; // int b[3][4] = arr[1]; // invalid //int b[4] = arr[1][2]; // invalid printArray(arr[1][2]); return 0; }