Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 130017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:52:54+00:00 2026-05-11T05:52:54+00:00

Assume you are designing and implementing a new language from scratch, though you may

  • 0

Assume you are designing and implementing a new language from scratch, though you may freely borrow ideas from existing languages/implementations.

Question: If a programmer declares a string variable (assume strongly typed), how would you choose to store this variable in memory?

There are many use cases, but do you have a particular model that is superior in certain areas? Is your string mutable? Is it mutable, but only to a certain length that isn’t the end of memory? Can I dynamically set the length, or can it only be done at compile time? Is it easy to access the ‘nth’ element? Does the string require a contiguous sector of memory? Could it be broken up into smaller strings?

Certain things to consider that programmers might like to do with your string: Calculating the length. Adding to the string. Extracting parts of the string (substrings). Applying Regex. Converting to a different value (number, boolean, etc)

EDIT: Clarifying what I mean.

If a user declares the following:

var Name : string 

How would you choose, as the language designer, how to store this in RAM? What are the advantages and disadvantages of your method, etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:52:54+00:00Added an answer on May 11, 2026 at 5:52 am

    If I were writing a language from the ground up, I would want both mutable and immutable string types defined. Immutability makes string-handling operations much faster, but creates serious limitations, particularly when it comes to concatenation and the like.

    The immutable string, I would store as a null-terminated array of unicode values. The mutable string, I would store as a linked list of unicode chars for easier reshuffling, slicing, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You're going to need to give us more details, I… May 11, 2026 at 3:13 pm
  • added an answer Put the space in your RewriteRule. Probably by the time… May 11, 2026 at 3:13 pm
  • added an answer OK, I found my problem -- I thought I was… May 11, 2026 at 3:12 pm

Related Questions

I'm about to enter the 1st phases of designing a commodities trading application. A
I'm currently designing/reworking the databinding part of an application that makes heavy use of
I'm working on an application for a charitable student organization. The application will track
Reading about the G.729 codec , I found this interesting tidbit about Comfort Noise

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.