argotorg / argotorg/solcore

String literals

Open
#264 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
113
Forks
9
Avg merge
4d 9h
Merged PRs (30d)
1

Description

Idea:

```
import dispatch;
// function f() -> memory(string) { return "uint256"; }) should desugar to

function stringLit75696e74323536() -> memory(string) {
let size : word = 7;
let ptr = allocate_memory(64);
assembly {
mstore(ptr, size)
mstore(add(ptr,32), 0x75696e7432353600000000000000000000000000000000000000000000000000)
}
return memory(ptr);
}

function f() -> memory(string) {
return stringLit75696e74323536();
}
```

with appropriate chunking for longer strings.

Parts of #176 can be reused.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading issue #176, which the proposal identifies as reusable prior art, then trace how the compiler currently represents and lowers string literals. The work is done when string literals desugar to generated memory-returning functions and longer strings are chunked appropriately, with compiler tests covering the transformation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, solidity
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.